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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.