LOGSELECT Procedure

Example 18.9 Risks

(View the complete code for this example.)

The following data set comes from an environmental study of workers in a cotton factory. A similar data set is analyzed in Ibrahim, Chen, and Lipsitz (2001). A contingency table is created from the study, where 912 workers are checked for dyspnea (difficult or labored respiration) and their exposure to cotton dust is recorded. The variable y indicates whether the worker has developed dyspnea, expd indicates whether the worker was exposed to cotton dust, and count is the number of workers with that profile.

data mylib.d3;
   input y expd count;
   datalines;
0 0 349
0 1 284
1 0 118
1 1 161
;

The syntax for computing risk statistics is very similar to that for the ODDSRATIO statement, except that you can specify only global options; there are no options for modifying individual risks. In the following program, both the ODDSRATIO and RISK statements are specified with no risk variables, so by default the expd variable is analyzed. The E option displays the profiles that are used in the computations of the model-predicted probabilities, and the SHOWPROBS option displays those probabilities.

proc logselect data=mylib.d3;
   freq count;
   class expd(ref='0');
   model y(event='1')=expd;
   oddsratio;
   risk / e showprobs;
run;

The population profiles that you are comparing are displayed in Output 18.9.1. The rows of this table are in the same order as the rows in the "Parameter Estimates" table. Using the notation from the section Risk Differences and Relative Risks, the profile is multiplied by the parameter estimates , and applying the inverse-logit function gives , as displayed in the P1 column of the "Risks" table in Output 18.9.2.

Output 18.9.1: Risk Coefficients

Coefficients for Risk Computations
ParameterL1_1L1_2
Parm111
Parm21 
Parm3 1


In Output 18.9.2, both the odds ratio results and the risk results show that exposure to cotton dust is a significant factor in a worker’s having dyspnea.

Output 18.9.2: Odds Ratio and Risk Difference

Odds Ratios
DescriptionEstimate95% Wald
Confidence Limits
p-ValuePercent
Change
expd 1 vs 01.6771.2622.2290.000467.67

Risk Differences
DescriptionEstimateStandard
Error
Chi-SquarePr > ChiSq95% Confidence LimitsP1P2
expd 1 vs 00.1091210.03038512.8980.00030.0495680.1686740.3617980.252677


Last updated: June 22, 2026