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

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 :

Capture d’écran 2020-05-04 à 15.29.19.png

Would you have quick tips?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Mic35
Obsidian | Level 7

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;
[...................]

 

View solution in original post

2 REPLIES 2
ed_sas_member
Meteorite | Level 14

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:

https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_logistic_details112.htm&docsetVer...

e.g. :

ODS OUTPUT FitStatistics = want;

proc print data=want;
run;

Capture d’écran 2020-05-04 à 16.54.15.png

Best,

Mic35
Obsidian | Level 7

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;
[...................]

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 893 views
  • 2 likes
  • 2 in conversation