The COUNTREG Procedure

Getting Started: COUNTREG Procedure

(View the complete code for this example.)

The COUNTREG procedure is similar in use to other SAS regression model procedures. For example, the following statements are used to estimate a Poisson regression model:

proc countreg data=one;
   model y = x / dist=poisson;
run;

The response variable y is numeric and has nonnegative integer values. To allow for variance greater than the mean, specify the DIST=NEGBIN option to fit the negative binomial model instead of the Poisson.

The following example illustrates the use of PROC COUNTREG. The data are taken from Long (1997) and can be found in the SAS/ETS Sample Library. This study examines how factors such as gender (fem), marital status (mar), number of young children (kid5), prestige of the graduate program (phd), and number of articles published by the mentor (ment) of a doctoral candidate in science affect the number of articles (art) published by the scientist.

The first 10 observations are shown in Figure 1.

Figure 1: Article Count Data

Obsartfemmarkid5phdment
130121.380008.0000
200004.290007.0000
340003.8500047.0000
410113.5900019.0000
510101.810000.0000
610113.590006.0000
700112.1200010.0000
800104.290002.0000
930122.580002.0000
1030111.800004.0000


The following SAS statements estimate the Poisson regression model:

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

The "Model Fit Summary" table, shown in Figure 2, lists several details about the model. By default, the COUNTREG procedure uses the Newton-Raphson optimization technique. The maximum log-likelihood value is shown, in addition to two information measures, Akaike’s information criterion (AIC) and Schwarz’s Bayesian information criterion (SBC), which can be used to compare competing Poisson models. Smaller values of these criteria indicate better models.

Figure 2: Estimation Summary Table for a Poisson Regression

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


The parameter estimates of the model and their standard errors are shown in Figure 3. All covariates are significant predictors of the number of articles, except for the prestige of the program (phd), which has a p-value of 0.6271.

Figure 3: Parameter Estimates of Poisson Regression

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


The following statements fit the negative binomial model. Although the Poisson model requires that the conditional mean equal the conditional variance, the negative binomial model allows for overdispersion; that is, the conditional variance can exceed the conditional mean.

proc countreg data=long97data;
   model art = fem mar kid5 phd ment / dist=negbin(p=2) method=qn;
run;

The fit summary is shown in Figure 4, and parameter estimates are listed in Figure 5.

Figure 4: Estimation Summary Table for a Negative Binomial Regression

The COUNTREG Procedure

Model Fit Summary
Dependent Variableart
Number of Observations915
Data SetWORK.LONG97DATA
ModelNegBin(p=2)
Log Likelihood-1561
Maximum Absolute Gradient5.72014E-7
Number of Iterations16
Optimization MethodQuasi-Newton
AIC3136
SBC3170


Figure 5: Parameter Estimates of Negative Binomial Regression

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept10.2561440.1385601.850.0645
fem1-0.2164180.072672-2.980.0029
mar10.1504890.0821061.830.0668
kid51-0.1764150.053060-3.320.0009
phd10.0152710.0360400.420.6718
ment10.0290820.0034708.38<.0001
_Alpha10.4416200.0529678.34<.0001


The parameter estimate for _Alpha of 0.4416 is an estimate of the dispersion parameter in the negative binomial distribution. A t test for the hypothesis upper H 0 colon alpha equals 0 is provided. It is highly significant, indicating overdispersion (p less-than 0.0001).

The null hypothesis upper H 0 colon alpha equals 0 can be also tested against the alternative alpha greater-than 0 by using the likelihood ratio test, as described by Cameron and Trivedi (1998, pp. 45, 77–78). The likelihood ratio test statistic is equal to minus 2 left-parenthesis script upper L Subscript upper P Baseline minus script upper L Subscript upper N upper B Baseline right-parenthesis equals minus 2 left-parenthesis negative 1651 plus 1561 right-parenthesis equals 180, where script upper L Subscript upper P and script upper L Subscript upper N upper B are the log likelihoods for the Poisson and negative binomial models, respectively. The likelihood ratio test is highly significant, providing strong evidence of overdispersion.

Last updated: December 20, 2021