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

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

Ashwini_uci
Obsidian | Level 7

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

SteveDenham
Jade | Level 19

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

Ashwini_uci
Obsidian | Level 7

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;

Ashwini_uci
Obsidian | Level 7

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;

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

Proc mixed is strictly for continuous (normal) data. So it cannot really do binary or categorical variables as the response variable.

SteveDenham
Jade | Level 19

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

Ashwini_uci
Obsidian | Level 7

The log looks fine. Doesn't say anything unusual.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 37 replies
  • 9948 views
  • 12 likes
  • 3 in conversation