BookmarkSubscribeRSS Feed
fetterbug
Calcite | Level 5

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

2 REPLIES 2
StatDave
SAS Super FREQ

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;

Reeza
Super User

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 2075 views
  • 0 likes
  • 3 in conversation