COUNTREG Procedure

Example 11.3 Variable Selection

(View the complete code for this example.)

This example demonstrates two algorithms of automatic variable selection in the COUNTREG procedure. Automatic variable selection is most effective when the number of possible candidates for explaining the variation of some variable is large. For clarity of exposition, this example uses only a small number of variables. The data set Article published by Long (1997) contains six variables. (This data set is also used in ZIP and ZINB Models for Data That Exhibit Extra Zeros.) The dependent variable Art records the number of articles that were published by a doctoral student in the last three years of his or her program. Explanatory variables include sex of the student (Fem), marital status (Mar), number of children (Kid5), prestige of the program (Phd), and publishing activity of the academic adviser (Ment). All these variables intuitively suggest their effect on the students’ primary academic output.

First, for comparison purposes, estimate the simple Poisson model. The choice of model is specified by DIST= option in the MODEL statement, as follows:

proc countreg data = long97data;
   model art = fem mar kid5 phd ment / dist = poisson;
run;

The output of these statements is shown in Output 11.3.1.

Output 11.3.1: Poisson Model for the Number of Published Articles

The COUNTREG Procedure

Model Fit Summary
Dependent Variableart
Number of Observations915
Data SetWORK.LONG97DATA
ModelPoisson
Log Likelihood-1651
Maximum Absolute Gradient3.57426E-9
Number of Iterations5
Optimization MethodNewton-Raphson
AIC3314
SBC3343

Algorithm converged.

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept10.3046170.1029822.960.0031
fem1-0.2245940.054614-4.11<.0001
mar10.1552430.0613752.530.0114
kid51-0.1848830.040127-4.61<.0001
phd10.0128230.0263970.490.6271
ment10.0255430.00200612.73<.0001


Note that the Newton-Raphson optimization algorithm took five steps to converge. All parameters, except for one, are significant at a 1% or 5% level, whereas Phd is not significant even at the 10% level.

In this case, it might be easy to identify the variables that have limited explanatory power. However, if the number of variables were large, the manual selection could be time-consuming and inaccurate. For a large number of variables, you would be better off in applying one of the automatic algorithms of variable selection. The following statements use the penalized likelihood method, which is indicated by SELECT=PEN option in the MODEL statement:

proc countreg data = long97data method = qn;
   model art = fem mar kid5 phd ment / dist   = poisson
                                       select = PEN;
run;

The output of these statements is shown in Output 11.3.2.

Output 11.3.2: Poisson Model for the Number of Published Articles with Penalized Likelihood Method

The COUNTREG Procedure

Model Fit Summary
Dependent Variableart
Number of Observations915
Data SetWORK.LONG97DATA
ModelPoisson
Log Likelihood-1651
Maximum Absolute Gradient3.48852E-7
Number of Iterations7
Optimization MethodQuasi-Newton
AIC3312
SBC3336

Algorithm converged.

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept10.3451740.0601255.74<.0001
fem1-0.2253030.054615-4.13<.0001
mar10.1521750.0610672.490.0127
kid51-0.1849930.040139-4.61<.0001
ment10.0257610.00195013.21<.0001


The "Parameter Estimates" table shows that the variable Phd was dropped from the model.

The next statements use the information criterion by specifying the SELECT=INFO option. The direction of the search is chosen to be forward, and the information criterion is AIC. In order to achieve the same selection of variables as for the penalized likelihood method, 0.001 is specified for the percentage of decrease in the information criterion necessary for the algorithm to stop.

proc countreg data = long97data;
   model art = fem mar kid5 phd ment / dist      = poisson
                                       select    = INFO
                                     ( direction = forward
                                       criter    = AIC
                                       lstop     = 0.001 );
run;

The output of these statements is shown in Output 11.3.3.

Output 11.3.3: Poisson Model for the Number of Published Articles with Search Method Using Information Criterion

The COUNTREG Procedure

Variable Selection Information
StepEffect EnteredEffect RemovedAICSBC
0Base Model 3487.1469503491.965874
1ment 3341.2864873350.924335
2fem 3330.7446043345.201376
3kid5 3316.5930363335.868733
4mar 3312.3488243336.443445

Model Fit Summary
Dependent Variableart
Number of Observations915
Data SetWORK.LONG97DATA
ModelPoisson
Log Likelihood-1651
Maximum Absolute Gradient1.28438E-9
Number of Iterations0
Optimization MethodNewton-Raphson
AIC3312
SBC3336

Algorithm converged.

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept10.3451740.0601255.74<.0001
fem1-0.2253030.054615-4.13<.0001
mar10.1521750.0610672.490.0127
kid51-0.1849930.040139-4.61<.0001
ment10.0257610.00195013.21<.0001


From the output, it is clear that the same set of variables was chosen as the result of information criterion algorithm. Note that the forward optimization algorithm starts with the constant as the only explanatory variable.

Last updated: June 19, 2025