LOGSELECT Procedure

RISK Statement

  • RISK <variable-list> </ options>;

The RISK statement produces relative risks or risk differences for variables that are used in your model. Because risk statistics directly compare the event probabilities, they provide an easier method than odds ratios for comparing your model’s implications for different subjects.

Given a population profile L, recall that the model-predicted event probability from a binary logistic regression model is computed as , where is your link function. The risk difference is the difference between the risk or event probability of a subject having one population profile, , and the event probability of having a different population profile, . Specifying the TYPE= option enables you to compute the relative risk, or risk ratio, which is the quotient of these two probabilities. If you do not specify any risk variables, then risk statistics are computed for every variable in the model. In a similar fashion, if you specify a multinomial response variable as a risk variable, then a common population profile, L, is used to compare the probability between two different response levels; however, if you use multinomial-trial syntax, you cannot specify those response variables as risk variables. Standard errors and confidence limits are produced by using the delta method. You can specify at most one RISK statement.

By default, all continuous variables are set to their means and all classification variables are set to their reference levels. If your risk variable is continuous, then by default the risk statistics compare the base subpopulation where the risk variable is set to its mean value to a population where that variable is one unit larger. If your risk variable is a classification variable, then by default the risk statistics compare each level of the risk variable to its reference level. If your risk variable is a multinomial response variable, then the risk statistics compare each level of the response to its reference level. You can also specify variables that are used to construct SPLINE and POLYNOMIAL effects as risk variables.

If you specify the PRIOR= option, the risk computations use the posterior predicted probabilities instead of the individual predicted probabilities, and the gradients are computed by using a finite-difference method.

For more information about the risk computations, see the section Risk Differences and Relative Risks.

You can specify the following 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= option is specified, then by default ALPHA=0.05.

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

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

value-list

specifies fixed values for the variable var. 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, classification 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 the following statements sets A to 'cat' and sets B to 7 and then 9:

   risk X / AT(A='cat' B=7 9);
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.

DIFF=REF | ALL

specifies whether to compute the risk statistics for a classification risk variable against the reference level (DIFF=REF) or to compare all pairs of the risk variable’s levels (DIFF=ALL). By default, DIFF=REF. The DIFF= option has no effect when the risk variable is continuous.

E

displays the and vectors; zero values are displayed as blanks. For cumulative response models, the intercept parameters are displayed as blanks and the slope parameters for a given risk are displayed only once. For the generalized logit model, the slope parameters that are used for a single response function are displayed, and the same parameters are used for all the other response functions. If you have a multinomial response model and also specify the dependent variable as a risk variable, then a single L vector is displayed.

REVERSE

swaps the and vectors in the computations. The risk difference is computed as instead of , and the risk ratio is computed as instead of .

SHOWPROBS

displays the two probabilities that are used in the risk statistic computations. These two values are always included in columns named P1 and P2 when you specify the DISPLAYOUT statement to output the "Risks" table.

TYPE=DIFFERENCE | RELATIVE

requests risk differences or relative risks. By default, TYPE=DIFFERENCE.

UNIT(variable1=list1 <…variable2=list2>)

specifies one or more numbers that represent the units of change for a continuous risk variable so that you can produce customized risk statistics. An estimate of the corresponding risk statistic is displayed for each specified unit of change. The UNIT option is ignored for classification variables. For example, the following statement requests a risk difference that represents the change in the risk when the variable X is increased by two units:

   risk X / UNIT(X=2);

By default, the unit of change is 1.

STDERR

indicates that the units of change that you specify in the UNIT option represent multiples of the sample standard error of the risk 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.

Last updated: June 22, 2026