07-24-2012 09:37 AM
I am using the following code to test an interaction with PROC LOGISTIC:
proc logistic data=aim1;
class group (param=ref ref='Usual_Care') surveycomp (param=ref ref='No');
model init1stapp (event='Yes')= group surveycomp group*surveycomp/expb lackfit;
When the Wald Odds Ratio table is produced, the reference group for surveycomp = "Yes".
|surveycomp No vs Yes at group=Intervention||0.349||0.228||0.535|
|surveycomp No vs Yes at group=Usual_Care||0.508||0.333||0.776|
I'd prefer the reference group be the same as in the class statement (surveycomp = "No"). Is there a way to specify this in the ODDSRATIO statement?
Thanks so much!
08-30-2012 01:08 PM
Unfortunately, the ODDSRATIO statement did not honor the REF= level set by the CLASS statement until the current (SAS 9.3 TS1M2) release. Prior to that release, you canuse the LSMEANS statement with the DIFF=CONTROL, EXP, and CL options
instead of the ODDSRATIO statement. The LSMEANS statement requires that you also use the PARAM=GLM option in the CLASS statement. For example, if variable A has values 1 and 2 and you want the odds ratio with the odds for level 1 in the denominator, the following LSMEANS statement provides the odds ratio estimate and confidence limits in the "Exponentiated" columns of the "Differences of A Least Squares Means" table.
class a b / param=glm;
model y=a b;
lsmeans a / diff=control('2') exp cl;
08-30-2012 02:14 PM
Not sure if the ref needs to be in quotes or not, but you can verify in the docs. May also be version issues as mentioned by statdave.