Hello all,
I am using PROC glimmix to analyze clustered data. I created a model with two interaction terms which were significant.
proc glimmix data= logistic order=data noclprint;
class hhid eanum netuse(ref='0') rainy(ref='0') age2(ref='0') ;
model pcrfinal (descending) = netuse age2 rainy netuse*rainy netuse*age2
aveprev10 / dist=binary link=logit ddfm=satterth OR S;
random int / subject=hhid(eanum);
Title 'Full model';
run;
I then went to look at stratified models based off of the significant interaction terms (making seperate models for where age2 = 1, where age2=0 and where rainy = 1 and where rainy=0):
proc glimmix data= logistic order=data noclprint;
class hhid eanum netuse rainy age2;
model pcrfinal (descending) = netuse age2 rainy netuse*rainy netuse*age2
aveprev10 / dist=binary link=logit ddfm=satterth OR S;
random int / subject=hhid(eanum);
Title 'Netuse, SAC, Rainy';
Where age2 = 1 ;
run;
and noticed that the estimated ORs for the main effect (There are 4 ORs from this model: The OR of pcrfinal comparing netuse=1 to netuse=0 among individuals with age2=1 and rainy = 1 etc.) in the stratified models differed substantially from the ORs derived from the full model.
I am trying to figure out why this is and if it is supposed to happen. My experience with simpler models has told me that the main estimates should not change between full and stratified models as long as all the other variables are the same.
I have looked at them a variety of a different ways and I always get different estimates from the full model and the stratified model, I'm not sure how to interpret this or why this is ocurring.
Thanks for any insight or advice anyone may have!
Could it be simply because the reference levels (as stated in the CLASS statement) are changed?
I don't think so, that would completely flip the odds ratio if SAS used a difference reference group, in this case it is the magnitude of the OR that is changing. I simply removed the reference values for the stratified models because by stratifying on age2, the reference group age2 = 0 is not in one of the smaller models and likewise for the models stratified on rainy.
The estimates change because the data changes, and as a result, the iterative procedure that maximizes the likelihood ends up in a different location.
The best way to get after the "stratified" values would be to use an ESTIMATE statement. Check out the BYCATEGORY option.
Steve Denham
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.