- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have a fairly simple question. I am using proc glimmix to compare the odds of death (binary outcome) of across several different levels a categorical variable ( call it cat with 4 levels 1, 2, 3, 4), adjusting for several clinical variables (var1-var4) and clustering by hospital. In the class statement, i can specify the reference level for cat (e.g., level 1) which will lead to estimates for 2 v 1, 3 v 1, and 4 v 1 which can be converted to odds ratios (the primary outcome we want to publish).
proc glimmix data=model;
class hospital cat (ref=first);
model death (event='1') = cat var1 var2 var3 var4 / dist=binary link=logit solution;
random intercept /subject=hospital; run;
However, we are interested in a variety of comparisons (e.g. 3 v 2, 3 v 4, 1 v 3, etc.). Again, we ideally want exponentiated values (odds ratios) and we do not want to have to run the model multiple times with different reference levels. I think the estimate statement could get me where i want to go but I am having trouble coding it properly as I am not so sure of the order of the categories when i define a reference level or when i dont define a reference level.
would the following estimate statements generate the correct comparisons:
estimate '3 v 2' cat 0 -1 1 0/exp cl;
estimate '3 v 4' cat 0 0 1 -1/exp cl;
estimate '1 v 3' cat 1 0 -1 0/exp cl;
Also, when using estimate statements does defining a reference level in the class statement (i.e., class hospital cat (ref=first)) impact the estimate statements?
Thanks for thinking about what i hope is a simple question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
And I don't think the class statement would impact estimate statement.
class statement is used to form DESIGN matrix ,and could impact the LSMEAN,SLICE statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Don't use contrast or estimate in this case. You will get the proper comparisons from the LSMEANS statement.
SAS has done the hard work of properly coding the contrast or estimate behind the scenes of the LSMEANS statement, so you don't have to struggle with it.
Paige Miller