BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sasprog
Calcite | Level 5

Hello, my study involves interaction terms, procedure indication and charlson co-morbidity index (CCI). Each variable has 3 levels:

 

procedure indication = non-diagnostic, diagnostic, EGD

CCI = 0, 1-2, >=3

 

In proc logistic, I would like to report the odds ratio and 95% CI, for example, procedure indication=EGD with all levels of CCI versus reference group which is procedure indication=non-diagnostic / cci=0. I was able to produce below from lsmeans option, but couldn't figure out how to report the OR in the way described above. Any help is appreciate. Thanks.

 

  reference             
procedure indicationcciprocedure indication_cciOR95% CI 
EGD>=3non-diagnostic02.701.774.10
EGD1-2non-diagnostic02.381.643.47
EGD0non-diagnostic02.321.643.26
diagnostic>=3non-diagnostic01.290.612.73
diagnostic1-2non-diagnostic01.030.591.80
diagnostic0non-diagnostic01.300.881.93
non-diagnostic>=3non-diagnostic01.751.052.91
non-diagnostic1-2non-diagnostic01.871.312.67
1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

No, the model is equivalent - same log likelihood and predicted values. The model is just reparameterized such that the 8 degrees of freedom (2 for proc_inc, 2 for cci, 4 for the interaction) are simply reassigned to the single Group predictor. 

View solution in original post

8 REPLIES 8
Reeza
Super User

Did you try an ODDSRATIO statement specifically?

 

If not, that's where I'd start.

If you need help with the coding you'll need to show your code.

 


@sasprog wrote:

Hello, my study involves interaction terms, procedure indication and charlson co-morbidity index (CCI). Each variable has 3 levels:

 

procedure indication = non-diagnostic, diagnostic, EGD

CCI = 0, 1-2, >=3

 

In proc logistic, I would like to report the odds ratio and 95% CI, for example, procedure indication=EGD with all levels of CCI versus reference group which is procedure indication=non-diagnostic / cci=0. I was able to produce below from lsmeans option, but couldn't figure out how to report the OR in the way described above. Any help is appreciate. Thanks.

 

    reference              
procedure indication cci procedure indication _cci OR 95% CI  
EGD >=3 non-diagnostic 0 2.70 1.77 4.10
EGD 1-2 non-diagnostic 0 2.38 1.64 3.47
EGD 0 non-diagnostic 0 2.32 1.64 3.26
diagnostic >=3 non-diagnostic 0 1.29 0.61 2.73
diagnostic 1-2 non-diagnostic 0 1.03 0.59 1.80
diagnostic 0 non-diagnostic 0 1.30 0.88 1.93
non-diagnostic >=3 non-diagnostic 0 1.75 1.05 2.91
non-diagnostic 1-2 non-diagnostic 0 1.87 1.31 2.67

 

sasprog
Calcite | Level 5

Thanks, Reeza. I did ODDSRATIO, SLICE, and LSMEANS. but none of them give the OR I need. Here is the code. 

 

proc logistic data=model;
class &mv1 / param=glm order=internal;
model sed(event="1")= &mv1 proc_ind*cci;
oddsratio proc_ind / at (cci=all);
slice proc_ind*cci / diff oddsratio cl;
lsmeans proc_ind*cci / ilink diff oddsratio cl;
run;

 

Thanks!

Reeza
Super User
Show your log and output then. I would have expected the ODDSRATIO statement above to work - does it not provide what you want or does it not provide any information?
sasprog
Calcite | Level 5

ODDSRATIO provide below OR. I believe this is the same as the ORs from LSMEANS.  

 

How to choose reference group from both variables (i.e. procedure indication=non-diagnostic / cci=0) and use all levels of one interaction term across the other interaction variable (i.e. procedure indication=EGD with all levels of CCI) to output OR?

 

Odds Ratio Estimates and Wald Confidence Intervals
Odds RatioEstimate95% Confidence Limitsp-Value
proc_ind EGD vs diagnostic at cci=>=32.0890.9774.4650.0573
proc_ind EGD vs non-diagnostic at cci=>=31.5440.9092.6220.1082
proc_ind diagnostic vs non-diagnostic at cci=>=30.7390.3271.6690.4669
proc_ind EGD vs diagnostic at cci=1-22.3251.3364.0460.0028
proc_ind EGD vs non-diagnostic at cci=1-21.2760.8941.8200.1789
proc_ind diagnostic vs non-diagnostic at cci=1-20.5490.3180.9480.0314
proc_ind EGD vs diagnostic at cci=01.7751.2152.5930.0030
proc_ind EGD vs non-diagnostic at cci=02.3151.6433.262<.0001
proc_ind diagnostic vs non-diagnostic at cci=01.3040.8811.9300.1841

 

SLICE gives below:

Chi-Square Test for proc_ind*cci Least Squares Means
Slice
SliceNum DFChi-SquarePr > ChiSq
proc_ind EGD20.540.7629

 

Simple Differences of proc_ind*cci Least Squares Means
Slicecci_cciEstimateStandard
Error
z ValuePr > |z|AlphaLowerUpperOdds
Ratio
Lower
Confidence
Limit for
Odds Ratio
Upper
Confidence
Limit for
Odds Ratio
proc_ind EGD>=31-20.12300.20750.590.55360.05-0.28380.52971.1310.7531.698
proc_ind EGD>=300.15250.21680.700.48160.05-0.27230.57741.1650.7621.781
proc_ind EGD1-200.029600.19050.160.87650.05-0.34370.40291.0300.7091.496
Reeza
Super User

Ok, I think I understand what you want and I think you need to refit your model for that. 

 

How to choose reference group from both variables (i.e. procedure indication=non-diagnostic / cci=0) and use all levels of one interaction term across the other interaction variable (i.e. procedure indication=EGD with all levels of CCI) to output OR?

 

You can specify the reference values in the CLASS statement.

 

class diag (ref='1') / param=ref;

You're using GLM which is fine, the oddsratio will account for that. 


Because of how the design matrix is formulated I can't see a way to get a single value out but I'll move this to the Stats' forum and maybe one of the statisticians can provide a better answer. 

 

Edit: @PGStats Rick Wicklin or Paige Miller can likely do a much better job with this question than me. 

StatDave
SAS Super FREQ

I would like to report the odds ratio and 95% CI, for example, procedure indication=EGD with all levels of CCI versus reference group which is procedure indication=non-diagnostic / cci=0. 

 

If I understand that what you want from the above is an odds ratio comparing one of the 9 groups (non-diag,0) against some or all of the other 8, then the most straightforward way to do that is simply to create a new variable (say, Group) that has 9 distinct values for each of the 9 proc_ind-CCI groups. Then, use the Group variable in the CLASS, MODEL, and ODDSRATIO statements instead of the proc_ind and CCI variables and their interaction. For example, assuming you create Group such that value 1 is your intended reference group  (you didn't tell us what &mv1 resolves to, so i'm ignoring it):

 

proc logistic data=model;
class Group(ref="1") / param=glm ;
model sed(event="1")= Group;
oddsratio Group / diff=ref;

run;

 

Reeza
Super User
That would be a different model though, with different accuracy and predictions.
StatDave
SAS Super FREQ

No, the model is equivalent - same log likelihood and predicted values. The model is just reparameterized such that the 8 degrees of freedom (2 for proc_inc, 2 for cci, 4 for the interaction) are simply reassigned to the single Group predictor. 

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
  • 8 replies
  • 1614 views
  • 3 likes
  • 3 in conversation