The LOGSELECT Procedure
Example 12.5 Odds Ratios
This example uses data that are examined in the section Getting Started: LOGSELECT Procedure and in Example 12.4 to demonstrate how you can use the ODDSRATIO statement to produce and customize odds ratios.
In the following code, the ODDSRATIO statement is specified with no options to produce odds ratios for all the main effects as shown in Output 12.5.1:
proc logselect data=mycas.getStarted;
model y(event='1') = x2 x5;
oddsratio;
run;
Output 12.5.1: Odds Ratios or Main-Effects Model
| Odds Ratios | |||||
|---|---|---|---|---|---|
| Description | Estimate | 95% Wald Confidence Limits | p-Value | Percent Change | |
| x2 | 1.233 | 0.999 | 1.521 | 0.0507 | 23.31 |
| x5 | 1.002 | 0.987 | 1.016 | 0.8381 | 0.15 |
From Output 12.5.1, a subject whose X2 value is one unit larger (than its current value) has 1.233 times the odds of having a Y = 1 response, and a subject whose X5 value is one unit larger has 1.002 times the odds.
If your model has interactions, then the odds ratio computations depend on the values of the interacting variables. The following code produces odds ratios for the main effects, but because of interactions, these odds ratios depend on the values of the interacting variables as displayed in Output 12.5.2:
proc logselect data=mycas.getStarted;
model y(event='1') = x2|x5;
oddsratio;
run;
Output 12.5.2: Odds Ratios with Interactions
| Odds Ratios | |||||
|---|---|---|---|---|---|
| Description | Estimate | 95% Wald Confidence Limits | p-Value | Percent Change | |
| x2 at x5=49.6 | 1.302 | 1.033 | 1.641 | 0.0252 | 30.24 |
| x5 at x2=3.41 | 1.004 | 0.989 | 1.020 | 0.5843 | 0.44 |
The odds ratios shown in Output 12.5.2 are computed at the mean values of the interacting variables as computed from the data used to fit the model. You can change these values by specifying an AT option for each individual odds ratio, as follows. The output is shown in Output 12.5.3.
proc logselect data=mycas.getStarted;
model y(event='1') = x2|x5;
oddsratio x2(at(x5=1)) x5(at(x2=3));
run;
Output 12.5.3: Odds Ratios with the AT Option
| Odds Ratios | |||||
|---|---|---|---|---|---|
| Description | Estimate | 95% Wald Confidence Limits | p-Value | Percent Change | |
| x2 at x5=1 | 1.925 | 1.160 | 3.193 | 0.0112 | 92.48 |
| x5 at x2=3 | 1.008 | 0.991 | 1.025 | 0.3648 | 0.77 |
Alternatively, you can obtain the same results shown in Output 12.5.3 by specifying the following AT global option:
proc logselect data=mycas.getStarted;
model y(event='1') = x2|x5;
oddsratio x2 x5 / at(x5=1 x2=3);
run;
When odds ratios are computed for continuous variables, by default the odds ratio compares the odds computed at the mean of the continuous variable to the odds computed one unit higher than the mean. However, it might be more interesting to compare larger differences; for example, if you are comparing ages, a 10-year difference might be more interesting than a 1-year difference. You can customize the odds ratios accordingly by specifying the desired unit difference as an individual option or as a global option. In the following code, the global options set the units for X2 to 2 and 3 and for X5 to 4. However, the individual odds ratio unit option for X2 overrides the global option value and sets the units for X2 to 5.
proc logselect data=mycas.getStarted;
model y(event='1') = x2|x5;
oddsratio x2(unit=5) x5 / unit(x2=2 3 x5=4);
run;
Output 12.5.4: Odds Ratios with the UNIT Option
| Odds Ratios | |||||
|---|---|---|---|---|---|
| Description | Estimate | 95% Wald Confidence Limits | p-Value | Percent Change | |
| x2 units=5 at x5=49.6 | 3.747 | 1.179 | 11.911 | 0.0252 | 274.72 |
| x5 units=4 at x2=3.41 | 1.018 | 0.956 | 1.084 | 0.5843 | 1.77 |
When odds ratios are computed for classification variables, by default the odds ratio compares the odds computed at each level of the classification variable to the odds computed at the reference level. For example, consider the ordinal response data from Example 12.4. The following program displays the default odds ratios in Output 12.5.5:
proc logselect data=mycas.Cheese;
class Additive(ref='4') / param=ref;
model y1-y9=Additive;
oddsratio;
run;
Output 12.5.5: Odds Ratios for Ordinal Response Model
| Odds Ratios | |||||
|---|---|---|---|---|---|
| Description | Estimate | 95% Wald Confidence Limits | p-Value | Percent Change | |
| Additive 1 vs 4 | 5.017 | 2.380 | 10.577 | <.0001 | 401.68 |
| Additive 2 vs 4 | 143.257 | 56.277 | 364.671 | <.0001 | 14225.70 |
| Additive 3 vs 4 | 27.735 | 12.133 | 63.399 | <.0001 | 2673.47 |
From the first line in Output 12.5.5, subjects who eat cheese with Additive = 1 have 5.017 times the odds to dislike it (Y1 end of the scale ) than to like it (Y9 end of the scale) than subjects who eat cheese with Additive = 4.
By default, the odds ratios shown in Output 12.5.5 compare each level of Additive to its reference level, Additive = 4. Output 12.5.6 compares all pairs of Additive levels by specifying the DIFF=ALL global option in the following program:
proc logselect data=mycas.Cheese;
class Additive(ref='4') / param=ref;
model y1-y9=Additive;
oddsratio / diff=all;
run;
Output 12.5.6: Odds Ratios with the DIFF=ALL Option
| Odds Ratios | |||||
|---|---|---|---|---|---|
| Description | Estimate | 95% Wald Confidence Limits | p-Value | Percent Change | |
| Additive 1 vs 2 | 0.035 | 0.015 | 0.081 | <.0001 | -96.50 |
| Additive 1 vs 3 | 0.181 | 0.087 | 0.375 | <.0001 | -81.91 |
| Additive 2 vs 3 | 5.165 | 2.475 | 10.778 | <.0001 | 416.53 |
| Additive 1 vs 4 | 5.017 | 2.380 | 10.577 | <.0001 | 401.68 |
| Additive 2 vs 4 | 143.257 | 56.277 | 364.671 | <.0001 | 14225.70 |
| Additive 3 vs 4 | 27.735 | 12.133 | 63.399 | <.0001 | 2673.47 |