- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Example in my case:
Using a mixed model for getting the rates of "failure" in patients undergoing surgery. Need to use mixed model because patients can have one to two eyes undergoing either of two treatment (surgeries) types.
Example of how data is structured:
1 0 Surgery1 0
1 1 Surgery1 0
2 0 Surgery2 1
3 1 Surgery1 0
How I built my model so far:
proc glimmix data=mydata method=laplace; class PtID Treatment Eye; model failure = Treatment|Eye; random Eye / subject=PtID(Treatment) type=cs; lsmeans Treatment / cl oddsratio ilink; title 'Eye Surgery'; run;
I really want to find the 95% odds ratio of failure between the two treatments. Could you please let me know what code I'll need? Am I way off in terms of how I'm organizing my data or how I've built my model? Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I think you need the LINK= option and the ODDSRATIO option in the MODEL statement
model failure = Treatment|Eye/link=logit oddsratio;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! That's giving me Odds ratios but unfortunately don't seem to be correct... Adding that line changed the covariance estimates and lsmeans estimates by a few orders of magnitude. The ORs are also way higher than what I was expecting
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Things change because by default, GLIMMIX assumes you have normally distributed errors. Adding the LINK= option assumes your response variable is binomial (1 or 0). So which fits your situation better?
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This might not answer your question directly, but it looks to me that you omitted the dist=binary link=logit options in the MODEL statement. Also the RANDOM statement seems to be for the R-side random effect, which means you need to add the RESIDUAL option in the RANDOM statement. But because of the METHOD=LAPLACE option you specified, R-side random effect might not be possible. You either need to take out this METHOD=option when adding the RESIDUAL option in the RANDOM statement, or, if you keep the METHOD=LAPLACE option, you might try the following RANDOM statement for the G-side random effect --
random int / subject=PtID(Treatment);
Thanks,
Jill