This page shows an example of poisson regression with footnotes explaining the output. First an example is shown using Stata, and then an example is shown using Mplus, to help you relate the output you are likely to be familiar with (Stata) to output that may be new to you (Mplus). We suggest that you view this page using two web browsers so you can show the page side by side showing the Stata output in one browser and the corresponding Mplus output in the other browser.
This example is from the Mplus User’s Guide (example 3.7) and we suggest that you see the Mplus User’s Guide for more details about this example. We thank the kind people at Muthén & Muthén for permission to use examples from their manual.
Example Using Stata
Here is a logit regression example using Stata with two continuous predictors x1 and x2 used to predict a binary outcome variable, u1.
infile u1 x1 x3 using https://stats.idre.ucla.edu/wp-content/uploads/2016/02/ex3.7.dat, clear
poisson u1 x1 x3
Iteration 0: log likelihood = -966.8842
Iteration 1: log likelihood = -966.88398
Iteration 2: log likelihood = -966.88398
Poisson regression Number of obs = 500
LR chi2(2) = 631.98
Prob > chi2 = 0.0000
Log likelihood = -966.88398 Pseudo R2 = 0.2463
------------------------------------------------------------------------------
u1 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x1 | .5330611C .0237869 22.41 0.000 .4864395 .5796827
x3 | .2494125C .0248628 10.03 0.000 .2006822 .2981427
_cons | 1.025773D .0283819 36.14 0.000 .9701454 1.0814
------------------------------------------------------------------------------
estat ic
------------------------------------------------------------------------------
Model | Obs ll(null) ll(model)A df AICB BICB
-------------+----------------------------------------------------------------
. | 500 -1282.874 -966.884 3 1939.768 1952.412
------------------------------------------------------------------------------
The output is labeled with superscripts to help you relate the later Mplus output to this Stata output. To summarize the output, both predictors in this model, x1 and x3, are significantly related to the outcome variable, u1. The estat ic command produces fit indices for the model including the log likelihood for the empty (null) model, the log likelihood for the model, as well as the AIC and BIC fit indices.
Mplus Example #1
Here is the same example illustrated in Mplus based on the https://stats.idre.ucla.edu/wp-content/uploads/2016/02/ex3.7.dat data file.
TITLE: this is an example of a Poisson regression for a count dependent variable with two covariates DATA: FILE IS https://stats.idre.ucla.edu/wp-content/uploads/2016/02/ex3.7.dat; VARIABLE: NAMES ARE u1 x1 x3; COUNT IS u1; MODEL: u1 ON x1 x3;
SUMMARY OF ANALYSIS
Number of observations 500
THE MODEL ESTIMATION TERMINATED NORMALLY
TESTS OF MODEL FIT
Loglikelihood
H0 Value -966.884A
Information Criteria
Number of Free Parameters 3
Akaike (AIC) 1939.768B
Bayesian (BIC) 1952.412B
Sample-Size Adjusted BIC 1942.890
(n* = (n + 2) / 24)
MODEL RESULTS
Estimates S.E. Est./S.E.
U1 ON
X1 0.533C 0.027 19.808
X3 0.249C 0.025 9.788
Intercepts
U1 1.026D 0.030 34.080
- This is the log likelihood value associated with the model (see the ll(model) from the estat ic command in Stata.
- These are the AIC and BIC values, see the AIC and BIC values from the estat ic command in Stata.
- These are the coefficients for the poisson model expressing the relationship between x1 x3 and u1, the same as those from the Stata poisson command.
- This is the intercept for the poisson model, the same as that from the Stata poisson command.
Data were collected on 316 students. The dataset contains academic information including math standardized scores (marhnce), language standardized scores (langnce), the number of days a student was absent (daysabs), and student’s gender (gender).
# Import data into R
d <- read.csv("https://stats.oarc.ucla.edu/wp-content/uploads/2023/12/lahigh.csv")
# Inspect the structure of the dataset
str(d)
## 'data.frame': 316 obs. of 10 variables:
## $ id : int 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 ...
## $ gender : chr "male" "male" "female" "female" ...
## $ ethnic : chr "hispanic" "hispanic" "hispanic" "hispanic" ...
## $ school : int 1 1 1 1 1 1 1 1 1 1 ...
## $ mathpr : int 63 27 20 16 2 71 63 3 51 49 ...
## $ langpr : int 36 44 38 38 14 47 33 5 54 36 ...
## $ mathnce: num 56.99 37.09 32.28 29.06 6.75 ...
## $ langnce: num 42.5 46.8 43.6 43.6 27.2 ...
## $ biling : chr "RFEP" "RFEP" "RFEP" "RFEP" ...
## $ daysabs: int 4 4 2 3 3 13 11 7 10 9 ...
The “gender” variable is a character variable with two possible values: “female” and “male”.
unique(d$gender)
## [1] "male" "female"
We are going to crate a new variable “female” where 1 is coded if the student was female and 0 if male.
d$female <- ifelse(d$gender=="female",1,0)
Run Poisson regression
As an example of a Poisson regression model output, we will model a number of days absent during the school year (daysabs) as a function of math standardized test score (mathnce), language standardized test score (langnce) and gender (female).
By selecting the Poisson model, we make the assumption that the dependent variable is a count (e.g., number of days absent). Additionally, we assume that the dependent variable is not overdispersed and does not have an excessive number of zeros compared to other count models, such as negative binomial or zero-inflated models.
In this dataset, each student has the same length of observation time (one school year). However, if the observation time varied among students (e.g., some individuals were followed for half a year, some for a year, and others for two years), using a Poisson model without accounting for this information would introduce bias. In scenarios where observation time varies per individual, it is necessary to incorporate an offset term into the model formula to appropriately address the differences in observation durations.
# Load "lme4" package for fitting generalized linear models
library(lme4)
# Run poisson regression
m <- glm(daysabs ~ mathnce + langnce + female, family = poisson, data = d)
summary(m)
##
## Call:
## glm(formula = daysabs ~ mathnce + langnce + female, family = poisson,
## data = d)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -4.0117 -2.5455 -1.1014 0.8956 11.0374
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.286745 0.069954 32.689 < 2e-16 ***
## mathnce -0.003523 0.001821 -1.934 0.0531 .
## langnce -0.012152 0.001835 -6.623 3.52e-11 ***
## female 0.400921 0.048412 8.281 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for poisson family taken to be 1)
##
## Null deviance: 2409.8 on 315 degrees of freedom
## Residual deviance: 2234.5 on 312 degrees of freedom
## AIC: 3103.9
##
## Number of Fisher Scoring iterations: 6
Annotated output
##
## Call:
## glm(formula = daysabs ~ mathnce + langnce + female, family = poisson,
## data = d)
## [...]
The first three lines show the formula that R used to fit the regression model.
## [...]
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -4.0117 -2.5455 -1.1014 0.8956 11.0374
## [...]
This is a summary of the distribution of the residuals from the model. Residuals are differences between actual observed values and the values that the model predicts. In addition to minimum, median and maximum, the summary provides lower quartile (1Q) under which 25% of the data points are found and upper quartile (3Q) under which 75% of the data points are found in the distribution of the residuals.
## [...]
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.286745 0.069954 32.689 < 2e-16 ***
## mathnce -0.003523 0.001821 -1.934 0.0531 .
## langnce -0.012152 0.001835 -6.623 3.52e-11 ***
## female 0.400921 0.048412 8.281 < 2e-16 ***
## ---
## [...]
Predictors and Estimates
The first column lists the names of predictors that were included in the model formula: (Intercept), mathnce, langnce, female.
The column “Estimate” provides estimated coefficients (or parameter estimates) for predicting number of days absent from school (daysabs) from independent variables specified in the model formula (mathnce, langnce, female).
The relationship between the outcome and predictor variable(s) in a Poisson regression is log-linear. The log link models the logarithm of the expected count as a function of the predictor variables. Regression coefficient represents a change in the logarithm of the expected count as the predictor variable increases one unit, assuming all other predictor variables are held constant.
The (Intercept) is the Poisson regression estimate when all variables in the model are evaluated at zero. In this case, the expected logarithm of number of days absent from school (daysabs) for males (the variable female is equal to zero) is 2.2867 units when standardized test scores for math (mathnce) and language (langnce) are zero. Note that value zero for math and language standardized scores is out of range of plausible test scores. If the test scores were mean-centered, the intercept would have a natural interpretation: the logarithm of expected number of days absent during the school year for males with average math and language standardized test scores.
mathnce – This estimate indicates that a one-point increase in the math standardized test score would result in an expected decrease of 0.0035 units in the difference between the logarithms of the expected number of days absent from school, when all other variables in the model are held constant.
langnce – This estimate indicates that a one-point increase in the language standardized test score would result in an expected decrease of 0.0121 units in the difference between the logarithms of the expected number of days absent from school, when all other variables in the model are held constant.
female – This estimate indicates that the difference in the logarithms of expected number of days absent from school is expected to be 0.401 units higher for females compared to males, while holding the other variables constant in the model.
Incidence rate ratios and multiplicative effects
As mentioned earlier, Poisson regression coefficient represent a difference in the logarithms of the expected counts as the predictor variable increases one unit, holding other predictor variables constant. Formally, this can be expressed as β = log(μx+1) – log(μx), where β is the regression coefficient, μ is the expected count and x is the predictor variable.The x+1 indicates predictor variable x when it increases by one unit. The difference of two logarithms is equal to the logarithm of their quotient, log( μx + 1) – log( μx ) = log( μx + 1 / μx ). Due to this property of logarithms, the parameter estimate can be interpreted as the logarithm of the ratio of expected counts. This is referred to as a rate ratio or relative risk.
In addition, our observations are counts, but we are modeling a rate at which these counts occur (e.g., counts per time or space). Therefore, Poisson regression coefficient is a logarithm of the rate ratio. In other words, the rate at which events occur is called the incidence rate. To obtain the incidence rate ratios (IRR) we have to exponentiate the Poisson regression coefficients.
# Get coefficients from the model
coeffs <- coef(m)
# Exponentiate coefficients to obtain incidence rate ratios (IRR)
IRR <- exp(coeffs)
IRR
## (Intercept) mathnce langnce female
## 9.8428469 0.9964830 0.9879214 1.4931992
The IRR expresses a multiplicative effect rather than an additive effect of the predictor on the outcome. In essence, exponentiated Poisson model coefficients (IRR) represent the factor by which the expected count (or rate) changes for a one-unit increase in the predictor variable. For example, an exponentiated coefficient of 1.5 means that the expected count (or rate) increases by 50% for each one-unit increase in the predictor variable. Conversely, the exponentiated coefficient of 0.75 means that expected count (or rate) decreases 25%. The exponentiated coefficient of 1 means there is no change.
The exponentiated (Intercept) coefficient 9.8428469 represents expect count of days a male student is expected to be absent from school when all other predictors are at zero. The exponentiated coefficient of mathnce means that a one unit increase in math standardized score is expected to decrease the rate of absence in male students by a factor of 0.9965, or by 0.0035%, holding all other predictors constant. The exponentiated langce coefficient means that a one unit increase in language standardized score is expected to decrease the rate of absence in male students by a factor of 0.9880, or by 0.012%, holding other variables constant. Finally, the rate of absence in female student compared to male students is expected to increase by a factor of 1.493, or by 49.3%, holding all other predictors constant.
St. Error
This column provides standard errors associated with the coefficients. The standard error is used for testing whether the parameter estimate is significantly different from 0 by dividing the estimate by its standard error to obtain a z value. The standard errors can also be used to form a confidence interval for the parameter estimate.
z value and PR(>|z|)
These two columns provide the test statistic and p-value. The test statistic (z value) represents the ratio of the coefficient to the standard error of the corresponding predictor. The z value follows a standard normal distribution, which is used to test against a two-sided alternative hypothesis that the coefficient is not equal to zero. The p-value (P>|z|) indicates the probability that a particular z test statistic is as extreme as or more extreme than what has been observed under the null hypothesis.
## [...]
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [...]
The asterisks provide a quick visual shortcut to p-values. A p-value that are extremely small, close to zero, is denoted by three asterisks. In this model, p-values of (Intercept), langcne and female coefficients have three asterisks. A p-value that is between a very small number and 0.001 is indicated by two asterisks. A p-value that is between 0.001 and 0.01 is indicated by one asterisk. A p-value that is at the alpha level set before the analysis is indicated by a dot. In this case, the p-value with a dot is 0.05 when rounded. All p-values that are above 0.05 do not receive any asterisks.
## [...]
## (Dispersion parameter for poisson family taken to be 1)
## [...]
By selecting the Poisson model, we assume that the dependent variable is not overdispersed and that the variance of the outcome variable is equal to its mean. The phrase “Dispersion parameter for Poisson family taken to be 1” in the output confirms this assumption.
## [...]
## Null deviance: 2409.8 on 315 degrees of freedom
## Residual deviance: 2234.5 on 312 degrees of freedom
## AIC: 3103.9
## [...]
The null deviance measures how the observed data deviates from the prediction of an intercept only model. The residual deviance measures how the observed data deviates from the predictions of the model being evaluated. A model with a relatively smaller deviance indicates a better fit.
AIC score is an abbreviation for Akaike Information Criteria. More complex models tend to overfit the data. The AIC score includes a penalty for model complexity (based on the number of parameters in the model). The scores are informative only when comparing two or more models fitted to the same dataset, and they are uninformative on their own. Lower scores, relative to other models, indicate better fit.
## [...]
## Number of Fisher Scoring iterations: 6
## [...]
This line refers to the number of iterations performed by the Fisher Scoring algorithm during the model estimation process. The Fisher Scoring algorithm is an iterative method used to estimate the parameters in maximum likelihood estimation (MLE) for generalized linear models.
This page shows an example of Poisson regression analysis with footnotes explaining the output in SPSS. The data collected were academic information on 316 students. The response variable is days absent during the school year (daysabs). We explore its relationship with math standardized test scores (mathnce), language standardized test scores (langnce) and gender (female).
As assumed for a Poisson model, our response variable is a count variable, and each subject has the same length of observation time. Had the observation time for subjects varied (i.e., some subjects were followed for half a year, some for a year and the rest for two years) and we were to neglect these differences in exposure time, our Poisson regression estimate would be biased since our model assumes all subjects had the same follow up time. Also, the Poisson model, as compared to other count models (i.e., negative binomial or zero-inflated models), is assumed the appropriate model. In other words, we assume that the response variable is not over-dispersed and does not have an excessive number of zeros.
The dataset can be downloaded here.
get file 'D:\data\lahigh.sav'.
recode gender ("female"=1) (else=0) into female.
exe.
In SPSS, Poisson models are treated as a subset of generalized linear models. This is reflected in the syntax. A generalized linear model is Poisson if the specified distribution is Poisson and the link function is log.
genlin daysabs with female mathnce langnce
/model female mathnce langnce distribution = poisson link = log
/print cps history solution fit.
| N | Percent | |
|---|---|---|
| Included | 316 | 100.0% |
| Excluded | 0 | 0.0% |
| Total | 316 | 100.0% |
Included: This is the number of observations from the dataset included in the model. A observation is included if the outcome variable and all predictor variables have valid, non-missing values.
Excluded: This is the number of observations from the dataset not included in the model due to missing data in any of the outcome or predictor variables.
Total: This is the sum of the included and excluded records. It is equal to the total number of observations in the dataset.
| Iteration | Update Type | Number of Step-halvings | Log Likelihoodb | Parameter | ||||
|---|---|---|---|---|---|---|---|---|
| (Intercept) | female | mathnce | langnce | (Scale) | ||||
| 0 | Initial | 0 | -2004.375 | 2.528223 | .354517 | -.000222 | -.006796 | 1 |
| 1 | Scoring | 0 | -1576.930 | 2.279542 | .379314 | -.002018 | -.009742 | 1 |
| 2 | Newton | 0 | -1548.227 | 2.277172 | .397654 | -.003305 | -.011816 | 1 |
| 3 | Newton | 0 | -1547.971 | 2.286590 | .400875 | -.003520 | -.012148 | 1 |
| 4 | Newton | 0 | -1547.971 | 2.286745 | .400921 | -.003523 | -.012152 | 1 |
| 5 | Newtona | 1 | -1547.971 | 2.286745 | .400921 | -.003523 | -.012152 | 1 |
| Redundant parameters are not displayed. Their values are always zero in all iterations. Dependent Variable: daysabs Model: (Intercept), female, mathnce, langnce | ||||||||
| a. All convergence criteria are satisfied. | ||||||||
| b. The full log likelihood function is displayed. | ||||||||
Iteration History: This is a listing of the log likelihoods at each iteration. Remember Poisson regression, like binary and ordered logistic regression, uses maximum likelihood estimation, which is an iterative procedure. The first iteration (called iteration 0) is the log likelihood of the “null” model. At each iteration, the log likelihood increases because the goal is to maximize the log likelihood. When the difference between successive iterations is very small, the model is said to have “converged”, the iterating stops, and the results are displayed. For more information on this process for binary outcomes, see Regression Models for Categorical and Limited Dependent Variables by J. Scott Long (page 52-61).
| Parameter | |||||
|---|---|---|---|---|---|
| (Intercept) | female | mathnce | langnce | ||
| Gradient Vector | -.001 | .000 | .000 | .000 | |
| Hessian Matrix | (Intercept) | -1836.000 | -1085.000 | -82680.056 | -84256.543 |
| female | -1085.000 | -1085.000 | -49883.301 | -52700.512 | |
| mathnce | -82680.056 | -49883.301 | -4333644.145 | -4229532.276 | |
| langnce | -84256.543 | -52700.512 | -4229532.276 | -4484788.562 | |
| The last evaluation of the gradient vector and Hessian matrix are displayed. Redundant parameters are not displayed. | |||||
Gradient Vector and Hessian Matrix: In our model, we are estimating k+1 parameters where k is the number of predictors: one for each of our predictors and one intercept parameter. The log likelihood of our model is calculated based on these estimated parameters. The gradient vector is the vector of partial derivatives of the log likelihood function with respect to the estimated parameters and the Hessian matrix is the square matrix of second derivatives of this log likelihood with respect to the estimated parameters. The variance-covariance matrix of the model parameters is the negative of the inverse of the Hessian. The values in the Hessian can suggest convergence problems in the model, but the iteration history and possible error messages provided by SPSS are more useful tools in diagnosing problems with the model.
| Value | df | Value/df | |
|---|---|---|---|
| Deviance | 2234.546 | 312 | 7.162 |
| Scaled Deviance | 2234.546 | 312 | |
| Pearson Chi-Square | 2774.414 | 312 | 8.892 |
| Scaled Pearson Chi-Square | 2774.414 | 312 | |
| Log Likelihoodb | -1547.971 | ||
| Akaike’s Information Criterion (AIC) | 3103.942 | ||
| Finite Sample Corrected AIC (AICC) | 3104.071 | ||
| Bayesian Information Criterion (BIC) | 3118.965 | ||
| Consistent AIC (CAIC) | 3122.965 | ||
| Dependent Variable: daysabs Model: (Intercept), female, mathnce, langnce | |||
| a. Information criteria are in smaller-is-better form. | |||
| b. The full log likelihood function is displayed and used in computing information criteria. | |||
Deviance: Deviance is usually defined as the log likelihood of the final model, multiplied by (-2). However, for Poisson regression, SPSS calculates the deviance as:
where $\hat{y}_i$ is the predicted value of $y_i$.
Note that the log likelihood of the model is -1547.971. The usual formulation of the deviance would yield (-2)(-1547.971) = 3095.942, which is greater than the deviance calculated using the above formula.
Pearson Chi-Square: This is a goodness-of-fit measure that compares the predicted values of the outcome variable with the actual values. It is calculated as
where $\hat{y}_i$ is the predicted value of $y_i$.
There is no scaling in this model, so we see that the Scaled Pearson Chi-Square is equal to the Pearson Chi-Square.
Log Likelihood: This is the log likelihood of the final model.
AIC: This is the Akaike information criterion, a goodness-of-fit measure defined as (–2 ln L + 2k) where k is the number of parameters in the model and L is the likelihood function of the final model.
BIC: This is the Bayesian information criterion, a goodness of fit measure defined as
where $n$ is the total number of observations, $k$ is the number of model parameters, and $logLik$ is the log-likelihood value of the final model.
| Parameter | B | Std. Error | 95% Wald Confidence Interval | Hypothesis Test | |||
|---|---|---|---|---|---|---|---|
| Lower | Upper | Wald Chi-Square | df | Sig. | |||
| (Intercept) | 2.287 | .0700 | 2.150 | 2.424 | 1068.590 | 1 | <.001 |
| female | .401 | .0484 | .306 | .496 | 68.582 | 1 | <.001 |
| mathnce | -.004 | .0018 | -.007 | 4.656E-5 | 3.742 | 1 | .053 |
| langnce | -.012 | .0018 | -.016 | -.009 | 43.865 | 1 | <.001 |
| (Scale) | 1a | ||||||
| Dependent Variable: daysabs Model: (Intercept), female, mathnce, langnce | |||||||
| a. Fixed at the displayed value. | |||||||
B: These are the estimated Poisson regression coefficients for the model. Recall that the response variable is a count variable, and Poisson regression models the log of the expected count as a function of the predictor variables. We can interpret the Poisson regression coefficient as follows: for a one unit change in the predictor variable, the difference in the logs of expected counts is expected to change by the respective regression coefficient, given the other predictor variables in the model are held constant.
(Intercept): This is the Poisson regression estimate when all variables in the model are evaluated at zero. For males (the variable female evaluated at zero) with zero mathnce and langnce test scores, the log of the expected count for daysabs is 2.287 units. Note that evaluating mathnce and langnce at zero is out of the range of plausible test scores. If the test scores were mean-centered, the intercept would have a natural interpretation: the log of the expected count for males with average mathnce and langnce test scores.
female: This is the estimated Poisson regression coefficient comparing females to males, given the other variables are held constant in the model. The difference in the logs of expected counts is expected to be 0.401 unit higher for females compared to males, while holding the other variables constant in the model. So if we consider two students, one male and one female, with identical math and language test scores, the female student will have a higher predicted value of log(# days absent) than the male student. Thus, we would expect the female student to have more days absent than her male counterpart.
mathnce: This is the Poisson regression estimate for a one unit increase in math standardized test score, given the other variables are held constant in the model. If a student were to increase her mathnce test score by one point, the difference in the logs of expected counts would be expected to decrease by 0.004 unit, while holding the other variables in the model constant. If we consider two students of the same sex who have the same language score, we would expect the student with the higher math score of the two to have fewer days absent than the other student.
langnce: This is the Poisson regression estimate for a one unit increase in language standardized test score, given the other variables are held constant in the model. If a student were to increase her langnce test score by one point, the difference in the logs of expected counts would be expected to decrease by 0.012 unit while holding the other variables in the model constant. If we consider two students of the same sex who have the same math score, we would expect the student with the higher language score of the two to have fewer days absent than the other student.
Std. Error: These are the standard errors of the individual regression coefficients. They are used both in the calculation of the Wald Chi-Square test statistic, superscript l, and the confidence interval of the regression coefficient, superscript k.
95% Wald Confidence Interval: This is the confidence interval (CI) of an individual Poisson regression coefficient, given the other predictors are in the model. For a given predictor variable with a level of 95% confidence, we’d say that we are 95% confident that upon repeated trials 95% of the CI’s would include the “true” population Poisson regression coefficient. It is calculated as B (zα/2)*(Std.Error), where zα/2 is a critical value on the standard normal distribution. The CI is equivalent to the z test statistic: if the CI includes zero, we’d fail to reject the null hypothesis that a particular regression coefficient is zero, given the other predictors are in the model. An advantage of a CI is that it is illustrative; it provides information on where the “true” parameter may lie and the precision of the point estimate.
Wald Chi-Square: These are the test statistics for the individual regression coefficients. The test statistic is the squared ratio of the coefficient B to the Std. Error of the respective predictor. The test statistic follows a Chi-Square distribution which is used to test against a two-sided alternative hypothesis that the B is not equal to zero.
df: This column lists the degrees of freedom for each of the variables included in the model. For each of these variables, the degree of freedom is 1.
Sig.: These are the p-values of the coefficients or the probability that, within a given model, the null hypothesis that a particular predictor’s regression coefficient is zero given that the rest of the predictors are in the model. They are based on the Wald Chi-Square test statistics of the predictors. The probability that a particular Wald test statistic is as extreme as, or more so, than what has been observed under the null hypothesis is defined by the p-value and presented here. By looking at the estimates of the standard errors to a greater degree of precision, we can calculate the test statistics and see that they match those produced in SPSS. To view the estimates with more decimal places displayed, click on the Parameter Estimates table in your SPSS output, then double-click on the number of interest.
(Intercept): The Wald Chi-Square test statistic testing (Intercept) is zero, given the other variables are in the model and evaluated at zero, is (2.286745/ 0.0699539)2 = 1068.590, with an associated p-value of <0.0001. If we set our alpha level at 0.05, we would reject the null hypothesis and conclude that (Intercept) on daysabs has been found to be statistically different from zero given mathnce, langnce and female are in the model and evaluated at zero.
female: The Wald Chi-Square test statistic testing the difference between the log of expected counts between males and females on daysabs is zero, given the other variables are in the model, is (0.4009209/0.0484122)2= 68.582, with an associated p-value of <0.0001. If we set our alpha level at 0.05, we would reject the null hypothesis and conclude that the coefficient for female is statistically different from zero given mathnce and langnce are in the model.
mathnce: The Wald Chi-Square test statistic testing the slope for mathnce on daysabs is zero, given the other variables are in the model, is (-0.0035232/0.0018213)2 = 3.742, with an associated p-value of 0.053. If we set our alpha level at 0.05, we would fail to reject the null hypothesis and conclude the poisson regression coefficient for mathnce is not statistically different from zero given langnce and female are in the model.
langnce: The Wald Chi-Square test statistic testing the slope for langnce on daysabs is zero, given the other variables are in the model, is (-0.0121521/0.0018348)2 = 43.865, with an associated p-value of <0.0001. If we set our alpha level at 0.05, we would reject the null hypothesis and conclude the poisson regression coefficient for langnce is statistically different from zero given mathnce and female are in the model.
This page shows an example of Poisson regression analysis with footnotes explaining the output. The data collected were academic information on 316 students. The response variable is days absent during the school year (daysabs), from which we explore its relationship with math standardized tests score (mathnce), language standardized tests score (langnce) and gender (female).
As assumed for a Poisson model our response variable is a count variable, and each subject has the same length of observation time. Had the observation time for subjects varied, the Poisson model would need to be adjusted to account for the varying length of observation time per subject. This point is discussed later in the page. Also, the Poisson model, as compared to other count models (i.e., negative binomial or zero-inflated models), is assumed the appropriate model. In other words, we assume that the dependent variable is not over-dispersed and does not have an excessive number of zeros. For more information on over-dispersion or excessive zeroes please review our Negative Binomial or Zero-Inflated webpages.
Also, note that each subject in our sample was followed for one school year. If this was not the case (i.e., some subjects were followed for half a year, some for a year and the rest for two years) and we were to neglect the exposure time, our Poisson regression estimate would be biased, since our model assumes all subjects had the same follow up time. If this was an issue, we would use the exposure option, exposure(varname), where varname corresponds to the length of time an individual was followed to adjust the Poisson regression estimates.
The first half of this page interprets the coefficients in terms of Poisson regression coefficients and the second half interprets the coefficients in terms of incidence rate ratios.
We also run the estat ic command to calculate the likelihood ratio chi-square statistic.
use https://stats.idre.ucla.edu/stat/stata/notes/lahigh, clear
generate female = (gender == 1)
poisson daysabs mathnce langnce female
Iteration 0: log likelihood = -1547.9709
Iteration 1: log likelihood = -1547.9709
Poisson regression Number of obs = 316
LR chi2(3) = 175.27
Prob > chi2 = 0.0000
Log likelihood = -1547.9709 Pseudo R2 = 0.0536
------------------------------------------------------------------------------
daysabs | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mathnce | -.0035232 .0018213 -1.93 0.053 -.007093 .0000466
langnce | -.0121521 .0018348 -6.62 0.000 -.0157483 -.0085559
female | .4009209 .0484122 8.28 0.000 .3060348 .495807
_cons | 2.286745 .0699539 32.69 0.000 2.149638 2.423852
------------------------------------------------------------------------------
estat ic
------------------------------------------------------------------------------
Model | Obs ll(null) ll(model) df AIC BIC
-------------+----------------------------------------------------------------
. | 316 -1635.608 -1547.971 4 3103.942 3118.965
------------------------------------------------------------------------------
Iteration Log, Model Summary and estat ic
Iteration 0: log likelihood = -1547.9709
Iteration 1: log likelihood = -1547.9709a
Poisson regression Number of obsc = 316
LR chi2(3)b = 175.27
Prob > chi2e = 0.0000
Log likelihood = -1547.9709b Pseudo R2f = 0.0536
estat ic
------------------------------------------------------------------------------
Model | Obs ll(null)d ll(model)d df AIC BIC
-------------+----------------------------------------------------------------
. | 316 -1635.608 -1547.971 4 3103.942 3118.965
------------------------------------------------------------------------------
a. Iteration Log – This is a listing of the log likelihood at each iteration. Poisson regression uses maximum likelihood estimation, which is an iterative procedure to obtain parameter estimates. If you are familiar with other regression models that use maximum likelihood (e.g., logistic regression), you may notice this iteration log behaves differently. Specifically, the log likelihood at iteration 0 does not correspond to the likelihood for the empty (or null) model. This is evident when we look under ll(null) from the estat ic command, which provides the log likelihood for the empty model. The log likelihood for the fitted model is given in the last iteration of the iteration log and under ll(model) from estat ic; note that both values are equal (unlike ll(null) and the log likelihood from iteration 0). The log likelihood for the fitted model is then used with ll(null) to calculate the Likelihood ratio chi-square test statistic.
b. Log Likelihood – This is the log likelihood of the fitted model. It is used in the calculation of the Likelihood Ratio (LR) chi-square test of whether all predictor variables’ regression coefficients are simultaneously zero and in tests of nested models.
c. Number of obs – This is the number of observations used in the Poisson regression. It may be less than the number of cases in the dataset if there are missing values for some variables in the model. By default, Stata does a listwise deletion of incomplete cases.
d. LR chi2(3), ll(null) and ll(model) from estat ic – This is the LR test statistic for the omnibus test that at least one predictor variable regression coefficient is not equal to zero in the model. The degrees of freedom (the number in parenthesis) of the LR test statistic is defined by the number of predictor variables (3). LR chi2(3) is calculated as -2*[ll(null) – ll(model)] = -2*[-1635.608 – (-1547.971)] = 175.274.
e. Prob > chi2 – This is the probability of getting a LR test statistic as extreme as, or more so, than the one observed under the null hypothesis; the null hypothesis is that all of the regression coefficients are simultaneously equal to zero. In other words, this is the probability of obtaining this chi-square test statistic (175.274) if there is in fact no effect of the predictor variables. This p-value is compared to a specified alpha level, our willingness to accept a Type I error, which is typically set at 0.05 or 0.01. The small p-value from the LR test, p < 0.00001, would lead us to conclude that at least one of the regression coefficients in the model is not equal to zero. The parameter of the chi-square distribution used to test the null hypothesis is defined by the degrees of freedom in the prior line, chi2(3).
f. Pseudo R2 – This is McFadden’s pseudo R-squared. It is calculated as 1 – ll(model)/ll(null) = 0.0536. Poisson regression does not have an equivalent to the R-squared found in OLS regression; however, many have tried to derive an equivalent measure. There are a variety of pseudo-R-square statistics. Because this statistic does not mean what R-square means in OLS regression (the proportion of variance of the response variable explained by the predictors), we suggest interpreting this statistic with caution.
Parameter Estimates
------------------------------------------------------------------------------
daysabsg | Coef.h Std. Err.i zj P>|z|j [95% Conf. Interval]k
-------------+----------------------------------------------------------------
mathnce | -.0035232 .0018213 -1.93 0.053 -.007093 .0000466
langnce | -.0121521 .0018348 -6.62 0.000 -.0157483 -.0085559
female | .4009209 .0484122 8.28 0.000 .3060348 .495807
_cons | 2.286745 .0699539 32.69 0.000 2.149638 2.423852
------------------------------------------------------------------------------
g. daysabs – This is the response variable in the Poisson regression. Underneath daysabs are the predictor variables and the intercept (_cons).
h. Coef. – These are the estimated Poisson regression coefficients for the model. Recall that the dependent variable is a count variable, and Poisson regression models the log of the expected count as a function of the predictor variables. We can interpret the Poisson regression coefficient as follows: for a one unit change in the predictor variable, the difference in the logs of expected counts is expected to change by the respective regression coefficient, given the other predictor variables in the model are held constant.
mathnce – This is the Poisson regression estimate for a one unit increase in math standardized test score, given the other variables are held constant in the model. If a student were to increase her mathnce test score by one point, the difference in the logs of expected counts would be expected to decrease by 0.0035 unit, while holding the other variables in the model constant.
langnce – This is the Poisson regression estimate for a one unit increase in language standardized test score, given the other variables are held constant in the model. If a student were to increase her langnce test score by one point, the difference in the logs of expected counts would be expected to decrease by 0.0122 unit while holding the other variables in the model constant.
female – This is the estimated Poisson regression coefficient comparing females to males, given the other variables are held constant in the model. The difference in the logs of expected counts is expected to be 0.4010 unit higher for females compared to males, while holding the other variables constant in the model.
_cons – This is the Poisson regression estimate when all variables in the model are evaluated at zero. For males (the variable female evaluated at zero) with zero mathnce and langnce test scores, the log of the expected count for daysabs is 2.2867 units. Note that evaluating mathnce and langnce at zero is out of the range of plausible test scores. If the test scores were mean-centered, the intercept would have a natural interpretation: the log of the expected count for males with average mathnce and langnce test scores.
i. Std. Err. – These are the standard errors of the individual regression coefficients. They are used both in the calculation of the z test statistic, superscript j, and the confidence interval of the regression coefficient, superscript k.
j. z and P>|z| – These are the test statistic and p-value, respectively, that the null hypothesis that an individual predictor’s regression coefficient is zero given that the rest of the predictors are in the model. The test statistic z is the ratio of the Coef. to the Std. Err. of the respective predictor. The z value follows a standard normal distribution which is used to test against a two-sided alternative hypothesis that the Coef. is not equal to zero. The probability that a particular z test statistic is as extreme as, or more so, than what has been observed under the null hypothesis is defined by P>|z|.
mathnce – The z test statistic testing the slope for mathnce on daysabs is zero, given the other variables are in the model, is (-0.0035/0.0018) -1.93, with an associated p-value of 0.053. If we set our alpha level at 0.05, we would fail to reject the null hypothesis and conclude the Poisson regression coefficient for mathnce is not statistically different from zero given langnce and female are in the model.
langnce – The z test statistic testing the slope for langnce on daysabs is zero, given the other variables are in the model, is (-0.0122/0.0018) -6.62, with an associated p-value of <0.0001. If we set our alpha level at 0.05, we would reject the null hypothesis and conclude the Poisson regression coefficient for langnce is statistically different from zero given mathnce and female are in the model.
female – The z test statistic testing the difference between the log of expected counts between males and females on daysabs is zero, given the other variables are in the model, is (0.4009/0.04841) -8.28, with an associated p-value of <0.0001. If we set our alpha level at 0.05, we would reject the null hypothesis and conclude that the coefficient for female is statistically different from zero given mathnce and langnce are in the model.
_cons – The z test statistic testing _cons is zero, given the other variables are in the model and evaluated at zero, is (2.2867/0.0670) -32.69, with an associated p-value of <0.0001. If we set our alpha level at 0.05, we would reject the null hypothesis and conclude that _cons on daysabs has been found to be statistically different from zero given mathnce, langnce and female are in the model and evaluated at zero.
k. [95% Conf. Interval] – This is the confidence interval (CI) of an individual poisson regression coefficient, given the other predictors are in the model. For a given predictor variable with a level of 95% confidence, we’d say that we are 95% confident that upon repeated trials 95% of the CI’s would include the “true” population Poisson regression coefficient. It is calculated as Coef. ± (zα/2)*(Std.Err.), where zα/2 is a critical value on the standard normal distribution. The CI is equivalent to the z test statistic: if the CI includes zero, we’d fail to reject the null hypothesis that a particular regression coefficient is zero, given the other predictors are in the model. An advantage of a CI is that it is illustrative; it provides information on where the “true” parameter may lie and the precision of the point estimate.
Incidence Rate Ratio Interpretation
The following is the interpretation of the Poisson regression in terms of incidence rate ratios, which can be obtained by poisson, irr after running the Poisson model or by specifying the irr option when the full model is specified. This part of the interpretation applies to the output below.
Before we interpret the coefficients in terms of incidence rate ratios, we must address how we can go from interpreting the Poisson regression coefficients as a difference between the logs of expected counts to incidence rate ratios. In the discussion above, Poisson regression coefficients were interpreted as the difference between the log of expected counts, where formally, this can be written as β = log( μx+1) – log( μx ), where β is the regression coefficient, μ is the expected count and the subscripts represent where the predictor variable, say x, is evaluated at x and x+1 (implying a one unit change in the predictor variable x). Recall that the difference of two logs is equal to the log of their quotient, log( μx+1) – log( μx ) = log( μx+1 / μx ), and therefore, we could have also interpreted the parameter estimate as the log of the ratio of expected counts: This explains the “ratio” in incidence rate ratios. In addition, what we referred to as a count can also be called a rate. By definition a rate is the number of events per time (or space), which our response variable qualifies as. Hence, we could also interpret the Poisson regression coefficients as the log of the rate ratio: This explains the “rate” in incidence rate ratio. Finally, the rate at which events occur is called the incidence rate; thus we arrive at being able to interpret the coefficients in terms of incidence rate ratios from our interpretation above.
poisson daysabs mathnce langnce female, irr
Iteration 0: log likelihood = -1547.9709
Iteration 1: log likelihood = -1547.9709
Poisson regression Number of obs = 316
LR chi2(3) = 175.27
Prob > chi2 = 0.0000
Log likelihood = -1547.9709 Pseudo R2 = 0.0536
------------------------------------------------------------------------------
daysabs | IRRa Std. Err. z P>|z| [95% Conf. Interval]b
-------------+----------------------------------------------------------------
mathnce | .996483 .0018149 -1.93 0.053 .9929321 1.000047
langnce | .9879214 .0018127 -6.62 0.000 .984375 .9914806
female | 1.493199 .072289 8.28 0.000 1.35803 1.641823
------------------------------------------------------------------------------
a. IRR – These are the incidence rate ratios for the Poisson model shown earlier. We obtain at the incidence rate ratio by exponentiating the Poisson regression coefficient
mathnce – This is the estimated rate ratio for a one unit increase in math standardized test score, given the other variables are held constant in the model. If a student were to increase his mathnce test score by one point, his rate ratio for daysabs would be expected to decrease by a factor of 0.9965, while holding all other variables in the model constant.
langnce – This is the estimated rate ratio for a one unit increase in language standardized test score, given the other variables are held constant in the model. If a student were to increase his langnce test score by one point, his rate ratio for daysabs would be expected to decrease by a factor 0.9880, while holding all other variables in the model constant.
female – This is the estimated rate ratio comparing females to males, given the other variables are held constant in the model. Females compared to males, while holding the other variable constant in the model, are expected to have a rate 1.493 times greater for daysabs.
b. [95% Conf. Interval] – This is the CI for the rate ratio given the other predictors are in the model. For a given predictor with a level of 95% confidence, we’d say that we are 95% confident that upon repeated trials, 95% of the CI’s would include the “true” population incidence rate ratio, given the other variables are in the model.
References: 1. Regression Analysis of Count Data, Second Edition by A. Colin Cameron and Pravin K. Trivedi 2. Modeling Count Data by Joseph M. Hilbe