Thanks Steve for all the help on this issue. I found out from an article and someone from SAS that the convergence problem is common with proc Glimmix , especially in very large datasets. Proc Mixed was recommended in this case and it also helps with random effects.
But I am not sure how I can get the odds ratios with Proc mixed. Any idea how I can get the Odds ratios?
Thanks,
Ashwini
Thanks @lvm for all the help on this issue. I found out from an article and someone from SAS that the convergence problem is common with proc Glimmix , especially in very large datasets. Proc Mixed was recommended in this case and it also helps with random effects.
But I am not sure how I can get the odds ratios with Proc mixed. Any idea how I can get the Odds ratios?
Thanks,
Ashwini
You could try looking at the LSmeans at different values of the continuous covariates (changing by a unit), and constructing the odds ratios from the estimated probabilities. Much easier for the categorical endpoints--odds ratios could be directly calculated from the LSmeans estimates of the probabilities. What will not be correct are the standard errors of the LSmeans.
Steve Denham
Thanks Steve! That's very helpful!
Another question I have is how do I define the 'event' to be modelled in Proc mixed?
For instance in the code below; the outcome variable is 'Died' and I would like the event Died=1/Yes to be modeled. How and where do I indicate that in the Proc mixed?
proc mixed data =library.data;
class hospid gender dm_all cm_htn_c cm_aids cm_alcohol cm_ANEMDEF cm_arth cm_bldloss cm_chf cm_chrnlung
cm_coag cm_depress cm_drug cm_hypothy cm_liver cm_lymph cm_lytes cm_mets cm_neuro cm_obese cm_para cm_perivasc
cm_psych cm_pulmcirc cm_renlfail cm_wghtloss cararrhythmia;
model died = age gender dm_all cm_htn_c cm_aids cm_alcohol cm_ANEMDEF cm_arth cm_bldloss
cm_chf cm_chrnlung cm_coag cm_depress cm_drug cm_hypothy cm_liver cm_lymph cm_lytes cm_mets cm_neuro cm_obese
cm_para cm_perivasc cm_psych cm_pulmcirc cm_renlfail cm_wghtloss cararrhythmia ;
random intercept / subject=hospid;
where stemi=0;
weight discwt;
run;
I also wonder where I can find guidance about how to specify comparisons in the lsmestimate statement; as included in the code below. Not sure what
1 0 -1 2 mean in the lsmestimate statement comparisions I saw in many examples online ..
lsmestimate gender 0 1/ exp cl;
proc mixed data =library.nismi091011_gender7 ;
class hospid gender dm_all cm_htn_c cm_aids cm_alcohol cm_ANEMDEF cm_arth cm_bldloss cm_chf cm_chrnlung
cm_coag cm_depress cm_drug cm_hypothy cm_liver cm_lymph cm_lytes cm_mets cm_neuro cm_obese cm_para cm_perivasc
cm_psych cm_pulmcirc cm_renlfail cm_wghtloss cararrhythmia;
model died = age gender dm_all cm_htn_c cm_aids cm_alcohol cm_ANEMDEF cm_arth cm_bldloss
cm_chf cm_chrnlung cm_coag cm_depress cm_drug cm_hypothy cm_liver cm_lymph cm_lytes cm_mets cm_neuro cm_obese
cm_para cm_perivasc cm_psych cm_pulmcirc cm_renlfail cm_wghtloss cararrhythmia ;
random intercept / subject=hospid;
lsmeans gender dm_all cm_htn_c;
lsmestimate gender 0 1/ exp cl;
weight discwt;
run;
quit;
Proc mixed is strictly for continuous (normal) data. So it cannot really do binary or categorical variables as the response variable.
Have to agree with . The best you could do with PROC MIXED is to get estimates of proportions.
As far as the meaning of the lsmestimate statement, it means find one times the lsmean of the second level of gender, then exponentiate that value and create a confidence bound. I would suggest that exponentiating a proportion is probably meaningless, and the confidence bounds are incorrect due to the fact that MIXED is treating the dependent variable as being Gaussian, when it is in fact a binomial.
Still, the lsmeans should look at least close to what you need (although biased toward p=0.5) and the variance components should provide reasonable starting parameters for GLIMMIX.
Steve Denham
The log looks fine. Doesn't say anything unusual.
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.