LOGSELECT Procedure

ODDSRATIO Statement

  • ODDSRATIO <variable <(options)>> …<variable <(options)>> </ global-options>;

The ODDSRATIO statement produces odds ratios for each odds ratio variable that you use in your model even when the odds ratio variable is involved in interactions with other variables or is used by a constructed effect. You can specify at most one ODDSRATIO statement. If you do not specify any odds ratio variables, then odds ratios are computed for every variable in the model. Odds ratio estimation is not available if you use elastic net selection. For more information, see the section Odds Ratio Estimation.

If your odds ratio variable is continuous, then by default the odds ratios compare the base subpopulation to one where that continuous variable is one unit larger. If your odds ratio variable is a classification variable, then by default the odds ratios compare each level of the odds ratio variable to its reference level.

If an odds ratio variable interacts with another variable, then the computed odds ratio depends on the value of the interacting variable. By default, interacting continuous variables are set to their means, and interacting classification variables are set to their reference level. The computed odds ratios are independent of the parameterization of any classification variable.

You can specify options for each individual odds ratio variable by enclosing the options in parentheses after the variable name. You can change the default options by specifying global-options after a slash (/). Global-options are applied to all the odds ratio variables; however, individual odds ratio variable options override the global-options.

You can specify the following options for the individual odds ratio requests in parentheses after the odds ratio variable:

AT(var=var-options <…var=var-options>)

enables you to specify fixed values or levels for a variable in the model when it interacts with the odds ratio variable. The following var-options are enabled when the var variable interacts with the odds ratio variable:

value-list

specifies fixed values for the variable var when var interacts with the odds ratio variable.

When var is a continuous variable, you can specify one or more numbers in the value-list. By default, continuous variables are set to their means. When var is a classification variable, you can specify one or more formatted levels of the variable enclosed in single quotes (for example, A=’cat’ ’dog’). By default, CLASS variables are set to their reference level. For example, if your model includes a classification variable A={cat,dog} and a continuous variable B, then specifying either of the following statements (the second uses a global-option) sets A to 'cat' and sets B to 7 and then 9:

   oddsratio X ( AT( A='cat' B=7 9 ) );
   oddsratio X / AT( A='cat' B=7 9 );

When var is a continuous variable, the values in the value-list are also used to construct SPLINE and POLYNOMIAL effects of that variable.

REF

specifies the reference level of var when var is a classification variable. This is the default for classification variables.

ALL

specifies every level of var when var is a classification variable.

UNIT=unit-list

specifies one or more numbers that represent the units of change for a continuous odds ratio variable so that you can produce customized odds ratios. An estimate of the corresponding odds ratio is displayed for each specified unit of change. The UNIT= option is ignored for CLASS variables. For example, specifying either of the following statements (the second uses a global-option) requests an odds ratio that represents the change in the odds when the variable X is increased by two units:

   oddsratio X ( UNIT=2 );
   oddsratio X / UNIT(X=2);

By default, UNIT=1.

STDERR

indicates that the units of change specified in the unit-list of the UNIT= option represent multiples of the sample standard error of the odds ratio variable, based on the observations that are used to fit the model. If you specify the STDERR option without the UNIT= option, then the unit of change is 1 standard error.

You can also specify the following global-options after a slash (/):

ALPHA=number

sets the significance level for producing confidence intervals. The ALPHA= value that you specify in the PROC LOGSELECT statement is the default. If neither ALPHA= value is specified, then by default ALPHA=0.05.

AT(var=var-options <…var=var-options>)

enables you to specify fixed levels or values for variables in the model that might interact with the odds ratio variable. See the AT= individual option for more information.

CL<=WALD | PL>

displays Wald confidence limits. If you specify CL=PL, then profile-likelihood confidence limits are also displayed. The confidence level is 0.95 by default; you can change it by specifying the ALPHA= option.

DIFF=REF | ALL

specifies whether the odds ratios for a classification odds ratio variable are computed against the reference level, or whether all pairs of the odds ratio variable’s levels are compared. By default, DIFF=REF. The DIFF= option has no effect when the odds ratio variable is continuous.

UNIT(var=unit-list <…var=unit-list> <STDERR>)

enables you to change the default units of change for continuous odds ratio variables. You specify var as the name of the continuous variable and unit-list as a list of the units. The STDERR option indicates that the unit-list represents multiples of the sample standard error of the variable. See the UNIT= and STDERR individual options for more information.

Odds ratio estimation is not available if you use elastic net selection.

Last updated: November 07, 2025