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
@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;
@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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.