BookmarkSubscribeRSS Feed
garystu
Calcite | Level 5

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:

Spoiler
PtID    Eye    Treatment    Failure

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

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I think you need the LINK= option and the ODDSRATIO option in the MODEL statement

 

 model failure = Treatment|Eye/link=logit oddsratio;
--
Paige Miller
garystu
Calcite | Level 5

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

PaigeMiller
Diamond | Level 26

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
jiltao
SAS Super FREQ

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 262 views
  • 1 like
  • 3 in conversation