Programming the statistical procedures from SAS

Oddsratio statement in proc logistic switches my reference group?

Reply
New Contributor
Posts: 3

Oddsratio statement in proc logistic switches my reference group?

Hey there,

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;

     oddsratio surveycomp;

run;

When the Wald Odds Ratio table is produced, the reference group for surveycomp = "Yes".

surveycomp No vs Yes at group=Intervention0.3490.2280.535
surveycomp No vs Yes at group=Usual_Care0.5080.3330.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!

-J

SAS Employee
Posts: 242

Re: Oddsratio statement in proc logistic switches my reference group?

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.

proc logistic;

class a b / param=glm;

model y=a b;

lsmeans a / diff=control('2') exp cl;

run;

Super User
Posts: 18,583

Re: Oddsratio statement in proc logistic switches my reference group?

try :

oddsratio surveycomp/diff=ref;

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.

Ask a Question
Discussion stats
  • 2 replies
  • 675 views
  • 0 likes
  • 3 in conversation