BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
oakHILLS68
Fluorite | Level 6

In PROC LOGISTIC (v.9.4) with SELECTION=STEPWISE, if you ask to output the ROC curve data (OUTROC), you get results for every step.  My question: Is there a way to restrict the output to just the final step?  Failing that, is there a way that I can use ODS to output the total number of steps so that I can subset the OUTROC dataset?  [I suppose I could use proc freq to find the maximum number of steps and then try to pass that maximum number to a DATA step.  But that's very kludgy.]

 

My current code:

proc logistic data=hem;
model outcome(ref='Alive') = IL_1ra IL_6 IL_8 IL_10 Eotaxin IP_10 MCP_1 / outroc=hem selection=stepwise;
output out=outhem predicted=predhem xbeta=xbhem;
run;

 

Thanks,

Dennis Hanseman

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

@oakHILLS68 wrote:

(...) is there a way that I can use ODS to output the total number of steps so that I can subset the OUTROC dataset?  [I suppose I could use proc freq to find the maximum number of steps and then try to pass that maximum number to a DATA step.  But that's very kludgy.]


Hello @oakHILLS68,

 

You can do the selection in one DATA step;

data want(drop=_s);
if _n_=1 then set hem(rename=(_step_=_s)) point=n;
set hem nobs=n;
if _step_=_s;
run;

View solution in original post

5 REPLIES 5
Reeza
Super User
If you're just interested in the final results, why not just use the final model and remove the selection option entirely?
oakHILLS68
Fluorite | Level 6
That's a good idea, but my code is in a macro. I need to run it multiple times with different macro parameters.

Thanks.
Reeza
Super User
So pipe the selected variables from the previous logistic regression to the next step using macro variables.
FreelanceReinh
Jade | Level 19

@oakHILLS68 wrote:

(...) is there a way that I can use ODS to output the total number of steps so that I can subset the OUTROC dataset?  [I suppose I could use proc freq to find the maximum number of steps and then try to pass that maximum number to a DATA step.  But that's very kludgy.]


Hello @oakHILLS68,

 

You can do the selection in one DATA step;

data want(drop=_s);
if _n_=1 then set hem(rename=(_step_=_s)) point=n;
set hem nobs=n;
if _step_=_s;
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 596 views
  • 2 likes
  • 3 in conversation