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 |
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.
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
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!
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 Ratio | Estimate | 95% Confidence Limits | p-Value | |
proc_ind EGD vs diagnostic at cci=>=3 | 2.089 | 0.977 | 4.465 | 0.0573 |
proc_ind EGD vs non-diagnostic at cci=>=3 | 1.544 | 0.909 | 2.622 | 0.1082 |
proc_ind diagnostic vs non-diagnostic at cci=>=3 | 0.739 | 0.327 | 1.669 | 0.4669 |
proc_ind EGD vs diagnostic at cci=1-2 | 2.325 | 1.336 | 4.046 | 0.0028 |
proc_ind EGD vs non-diagnostic at cci=1-2 | 1.276 | 0.894 | 1.820 | 0.1789 |
proc_ind diagnostic vs non-diagnostic at cci=1-2 | 0.549 | 0.318 | 0.948 | 0.0314 |
proc_ind EGD vs diagnostic at cci=0 | 1.775 | 1.215 | 2.593 | 0.0030 |
proc_ind EGD vs non-diagnostic at cci=0 | 2.315 | 1.643 | 3.262 | <.0001 |
proc_ind diagnostic vs non-diagnostic at cci=0 | 1.304 | 0.881 | 1.930 | 0.1841 |
SLICE gives below:
Chi-Square Test for proc_ind*cci Least Squares Means Slice | |||
Slice | Num DF | Chi-Square | Pr > ChiSq |
proc_ind EGD | 2 | 0.54 | 0.7629 |
Simple Differences of proc_ind*cci Least Squares Means | ||||||||||||
Slice | cci | _cci | Estimate | Standard Error | z Value | Pr > |z| | Alpha | Lower | Upper | Odds Ratio | Lower Confidence Limit for Odds Ratio | Upper Confidence Limit for Odds Ratio |
proc_ind EGD | >=3 | 1-2 | 0.1230 | 0.2075 | 0.59 | 0.5536 | 0.05 | -0.2838 | 0.5297 | 1.131 | 0.753 | 1.698 |
proc_ind EGD | >=3 | 0 | 0.1525 | 0.2168 | 0.70 | 0.4816 | 0.05 | -0.2723 | 0.5774 | 1.165 | 0.762 | 1.781 |
proc_ind EGD | 1-2 | 0 | 0.02960 | 0.1905 | 0.16 | 0.8765 | 0.05 | -0.3437 | 0.4029 | 1.030 | 0.709 | 1.496 |
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.
> 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;
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.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.