Hello,
I would like to ask questions related to my project that I am currently doing.
Have a data which is nonparametric, which fairly recently relaised..
So before I notice I need to apply nonparametric method, I did logistic regression (univariate, univariable).
Then as I said data has characteristics and now studying nonparametric method but there are many things that I am no sure.
So my questions are:
1. Can I use "proc adaptivereg" when there is one variable and one variate?
This is because I have looked at below and kindly explained that the proc adaptivereg is for multivariate..
1-1. when it is multivariate, does that mean I can have only one variable or it doesnt matter in multivariate setting?
2. If question 1 is no, then can you recommend syntax for nonparametric data for simple logistic regression?
(I used proc logistic before)
It would be great help for me.
Many thanks and best wishes,
Danielle.
Yes, you can use PROC ADAPTIVEREG for univariate analysis. "Multivariate" means "one or more" in this situation. Here is some data and an example:
data Cars;
set sashelp.cars;
where Origin in ('Asia', 'USA');
Event = (Origin="USA"); /* equivalent 0/1 binary numerical response */
run;
proc sort data=cars;
by weight;
run;
proc adaptivereg data=cars;
model Origin(event="USA") = weight;
output out=AdaptiveOut p(ilink);
run;
proc sgplot data=AdaptiveOut noautolegend;
scatter x=weight y=Event / jitter jitterwidth=0.1;
series x=weight y=Pred;
yaxis min=0 max=1 grid label="Predicted Probability" offsetmax=0.1 offsetmin=0.1;
run;
As Paige and others have said, you can also use spline effects with PROC LOGISTIC. For a discussion, see the article "Regression with restricted cubic splines in SAS". Here is an example, modified from that article:
/* create sample data; sort by independent variable for graphing */
data Cars;
set sashelp.cars;
where Origin in ('Asia', 'USA');
Event = (Origin="USA"); /* equivalent 0/1 binary numerical response */
run;
proc sort data=cars;
by weight;
run;
/* Fit data by using restricted cubic splines.
The EFFECT statement is supported by many procedures: */
title "Restricted Cubic Spline Regression";
proc logistic data=cars plots=none;
effect spl = spline(weight / details naturalcubic basis=tpf(noint)
knotmethod=percentiles(5) );
model Origin(event="USA") = spl; /* fit model by using spline effects */
output out=SplineOut predicted=PredProb; /* output predicted values for graphing */
quit;
proc sgplot data=SplineOut noautolegend;
scatter x=weight y=Event / jitter jitterwidth=0.1;
series x=weight y=PredProb;
yaxis min=0 max=1 grid label="Predicted Probability" offsetmax=0.1 offsetmin=0.1;
run;
Let's start at the beginning. Why do you think you need a non-parametric analysis here?
Predicted probability and result of logistic regression say different things. For example predicted probability decreases from age 15 to 31 then increase from 32 to 49 whilst logistic regression says age 1 year older probability will be decreasing. So it seems non-linear relations but regressions says linear which I am not sure but just reckon.
You can fit a polynomial regression in PROC LOGISTIC.
You can use the EFFECT statement in PROC LOGISTIC to fit a spline through the x-variable that might be a good predictor or the probability.
Thank you so much!!
Oh I see! thanks!
I remembered @Rick_SAS wrote a blog about analysis NBA data by using two different non-parameter logistic regression .
Yes, you can use PROC ADAPTIVEREG for univariate analysis. "Multivariate" means "one or more" in this situation. Here is some data and an example:
data Cars;
set sashelp.cars;
where Origin in ('Asia', 'USA');
Event = (Origin="USA"); /* equivalent 0/1 binary numerical response */
run;
proc sort data=cars;
by weight;
run;
proc adaptivereg data=cars;
model Origin(event="USA") = weight;
output out=AdaptiveOut p(ilink);
run;
proc sgplot data=AdaptiveOut noautolegend;
scatter x=weight y=Event / jitter jitterwidth=0.1;
series x=weight y=Pred;
yaxis min=0 max=1 grid label="Predicted Probability" offsetmax=0.1 offsetmin=0.1;
run;
As Paige and others have said, you can also use spline effects with PROC LOGISTIC. For a discussion, see the article "Regression with restricted cubic splines in SAS". Here is an example, modified from that article:
/* create sample data; sort by independent variable for graphing */
data Cars;
set sashelp.cars;
where Origin in ('Asia', 'USA');
Event = (Origin="USA"); /* equivalent 0/1 binary numerical response */
run;
proc sort data=cars;
by weight;
run;
/* Fit data by using restricted cubic splines.
The EFFECT statement is supported by many procedures: */
title "Restricted Cubic Spline Regression";
proc logistic data=cars plots=none;
effect spl = spline(weight / details naturalcubic basis=tpf(noint)
knotmethod=percentiles(5) );
model Origin(event="USA") = spl; /* fit model by using spline effects */
output out=SplineOut predicted=PredProb; /* output predicted values for graphing */
quit;
proc sgplot data=SplineOut noautolegend;
scatter x=weight y=Event / jitter jitterwidth=0.1;
series x=weight y=PredProb;
yaxis min=0 max=1 grid label="Predicted Probability" offsetmax=0.1 offsetmin=0.1;
run;
Thank you so much!!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.