Hello,
I try to get a table with AIC and AICc in Proc logistic.
I rode various articles and I decided to try the Qinley Huang method with %ic_logistic macro (https://www.pharmasug.org/proceedings/2014/SP/PharmaSUG-2014-SP04.pdf) but I meet a problem i think due to my junior experience (to create the combiantion and model specification sheets output).
The aim is to get this type of table :
Would you have quick tips?
Thanks
UPDATE : 2021-JAN
proc logistic data= base outest=betas;
model Yvar(event="YES")= Xvariables / selection=backward
slentry=0.2
slstay=0.05 details lackfit;
ods output EffectInModel =effect;
ods output fitstatistics=AIC( keep=Criterion InterceptAndCovariates step
rename=(InterceptAndCovariates=AIC) where=(Criterion='AIC'));
ods output fitstatistics= BIC (keep=Criterion InterceptAndCovariates step
rename= (InterceptAndCovariates=BIC) where= (Criterion='SC'));
run;
*GET NAME VARS;
proc freq data=effect noprint;
table step*effect / out=sum1;run;
data sum1(keep=step effect count ); set sum1; run;
proc sort data=sum1; by step;run;
#VAR NAME BY STEP;
proc summary nway data=sum1 missing;
class step;
output out=new (drop=_type_ _freq_) idgroup(out[10](effect)=); run;
data want(keep= step varl); set new;
length varl $1000;
varl = catx('- ', of effect:); run;
*MERGE;
data final(drop=criterion) ;
merge aic bic want; by step; run;
#REPORT;
[...................]
Hi @Mic35
PROC LOGISTIC assigns a name to each table it creates.
You can use these names to reference the table when using the ODS OUTPUT to select tables and create output data sets:
e.g. :
ODS OUTPUT FitStatistics = want;
proc print data=want;
run;
Best,
UPDATE : 2021-JAN
proc logistic data= base outest=betas;
model Yvar(event="YES")= Xvariables / selection=backward
slentry=0.2
slstay=0.05 details lackfit;
ods output EffectInModel =effect;
ods output fitstatistics=AIC( keep=Criterion InterceptAndCovariates step
rename=(InterceptAndCovariates=AIC) where=(Criterion='AIC'));
ods output fitstatistics= BIC (keep=Criterion InterceptAndCovariates step
rename= (InterceptAndCovariates=BIC) where= (Criterion='SC'));
run;
*GET NAME VARS;
proc freq data=effect noprint;
table step*effect / out=sum1;run;
data sum1(keep=step effect count ); set sum1; run;
proc sort data=sum1; by step;run;
#VAR NAME BY STEP;
proc summary nway data=sum1 missing;
class step;
output out=new (drop=_type_ _freq_) idgroup(out[10](effect)=); run;
data want(keep= step varl); set new;
length varl $1000;
varl = catx('- ', of effect:); run;
*MERGE;
data final(drop=criterion) ;
merge aic bic want; by step; run;
#REPORT;
[...................]
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.