BookmarkSubscribeRSS Feed
lbritton
Calcite | Level 5

Hi! I’m looking for help with PROC SURVEYLOGISTIC in SAS 94. How do I determine whether an interaction model and a main effects model has superior fit? 

 

I am examining two different outcome: one set of models for “no prenatal care” (Model Ia and Ib) and another set of models for “early prenatal care” (Model IIa and IIb). I'm interested in whether an interaction between early recognition of pregnancy and pregnancy intention exists. For both sets of models, the Schwarz Criterion and the -2LogL values were smaller for the interaction model, suggesting superior interaction model fit. However, the interaction term was significant in the “Early Prenatal Care” model, but not in the “No Prenatal Care” model.  Do I decide between the interaction model & the main effects model based on the Schwarz Criterion/-2Log L? Or Based on the whether the interaction term is significant? 

 

If I were using PROC LOGISTIC, I would  add "scale=none aggregate" and "details lackfit" to the model term to get the Deviance & Pearson Goodness-of-Fit statistics, the Residual Chi-Square Test, and the Hosmer & Oemeshow Goodness-of-fit (based on Ch8 of Stokes, Davis & Koch "Categorical Data Analysis Using SAS"). However, when I added these after PROC SURVEYLOGISTIC, I got errors. Should I include commands in my code to generate other statistics which tell me which model fit is better?

 

 

 

/* MODEL Ia: MAIN EFFECTS MODEL FOR NO PRENATAL CARE */
Proc surveylogistic data=pregnancy3;
stratum SEST;
cluster SECU;
weight WGT2013_2015;
class EARLYLEARN(REF='1') int(ref='1') ed(ref='3') Hispanic(ref='2')
race(ref='2') rmarital(ref='1') firstpreg(REF='1') povertylevel(ref='1')
agecat(ref='1') insurance(ref='1')/ param=ref;
Model NOPRENATAL = EARLYLEARN INT race hispanic povertylevel
rmarital ed firstpreg agecat insurance / rsquare;
contrast 'EL=1, int 2 vs 1' int 1 0 0/estimate=exp;
contrast 'EL=1, int 3 vs 1' int 0 1 0/estimate=exp;
contrast 'EL=1, int 4 vs 1' int 0 0 1/estimate=exp;
Run;

 

 

/* MODEL Ib: INTERACTION MODEL FOR NO PRENATAL CARE) */
 
Proc surveylogistic data=pregnancy3;
stratum SEST;
cluster SECU;
weight WGT2013_2015;
class EARLYLEARN(REF='1') int(ref='1') ed(ref='3') Hispanic(ref='2')
race(ref='2') rmarital(ref='1') firstpreg(REF='1') povertylevel(ref='1')
agecat(ref='1') insurance(ref='1')/ param=ref;
Model NOPRENATAL = EARLYLEARN|INT race hispanic povertylevel
rmarital ed firstpreg agecat insurance / rsquare;
contrast 'int=1, EL 0 vs 1' earlylearn 1/estimate=exp;
contrast 'EL=1, int 2 vs 1' int 1 0 0/estimate=exp;
contrast 'EL=1, int 3 vs 1' int 0 1 0/estimate=exp;
contrast 'EL=1, int 4 vs 1' int 0 0 1/estimate=exp;
contrast 'EL=0, int 2 vs 1' int 1 0 0 earlylearn*int 1 0 0/estimate=exp;
contrast 'EL=0, int 3 vs 1' int 0 1 0 earlylearn*int 0 1 0/estimate=exp;
contrast 'EL=0, int 4 vs 1' int 0 0 1 earlylearn*int 0 0 1/estimate=exp;
Run;

 

/*Model IIa: MAIN EFFECTS MODEL FOR EARLY PRENATAL CARE */
Proc surveylogistic data=pregnancy3;
stratum SEST;
cluster SECU;
weight WGT2013_2015;
class EARLYLEARN(REF='1') int(ref='1') ed(ref='3') Hispanic(ref='2')
race(ref='2') rmarital(ref='1') firstpreg(REF='1') povertylevel(ref='1')
agecat(ref='1') insurance(ref='1')/ param=ref;
Model EARLYPRENATAL = EARLYLEARN INT race hispanic povertylevel
rmarital ed firstpreg agecat insurance;
contrast 'int=1, EL 0 vs 1' earlylearn 1/estimate=exp;
contrast 'EL=1, int 2 vs 1' int 1 0 0/estimate=exp;
contrast 'EL=1, int 3 vs 1' int 0 1 0/estimate=exp;
contrast 'EL=1, int 4 vs 1' int 0 0 1/estimate=exp;
Run;

 

 

/* MODEL IIb: Interaction model for LATER PRENATAL CARE */
Proc surveylogistic data=pregnancy3;
stratum SEST;
cluster SECU;
weight WGT2013_2015;
class EARLYLEARN(REF='1') int(ref='1') ed(ref='3') Hispanic(ref='2')
race(ref='2') rmarital(ref='1') firstpreg(REF='1') povertylevel(ref='1')
agecat(ref='1') insurance(ref='1')/ param=ref;
Model EARLYPRENATAL = EARLYLEARN|INT race hispanic povertylevel
rmarital ed firstpreg agecat insurance;
contrast 'int=1, EL 0 vs 1' earlylearn 1/estimate=exp;
contrast 'EL=1, int 2 vs 1' int 1 0 0/estimate=exp;
contrast 'EL=1, int 3 vs 1' int 0 1 0/estimate=exp;
contrast 'EL=1, int 4 vs 1' int 0 0 1/estimate=exp;
contrast 'EL=0, int 2 vs 1' int 1 0 0 earlylearn*int 1 0 0/estimate=exp;
contrast 'EL=0, int 3 vs 1' int 0 1 0 earlylearn*int 0 1 0/estimate=exp;
contrast 'EL=0, int 4 vs 1' int 0 0 1 earlylearn*int 0 0 1/estimate=exp;
Run;
 

 

 

I really appreciate any help, because I’ve searched through the archives without finding an answer & I find the SAS documentation not entirely clarifying (ie https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_surveylogis...).

 

Thank you very much!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 0 replies
  • 1158 views
  • 0 likes
  • 1 in conversation