Poisson regression with endogenous variables | Order |
ivpoisson fits a Poisson regression model (a.k.a. exponential conditional mean model) in which one or more of the regressors are endogenous. Poisson is frequently used to model count outcomes or to model nonnegative outcome variables.
Suppose we are modeling the number of automobile accidents involving young male drivers.
We will assume the number of accidents comes from a Poisson distribution with mean
exp(b0 + b1 horsepower + b2 x1 + b3 x2)
In this artificial example, we will assume horsepower, in addition to having a direct effect, also reflects an underlying tendency for risky behavior. We will use x3 and x4 as measures of the tendency, though x3 and x4 might have nothing whatsoever to do with cars. We will use the full set of variables x1 through x4 as instruments for horsepower.
We will estimate our additive model using the efficient two-step GMM. We type
. ivpoisson gmm accidents x1 x2 (horsepower = x3 x4) Exponential mean model with endogenous regressors Number of parameters = 4 Number of obs = 1000 Number of moments = 5 Initial weight matrix: Unadjusted GMM weight matrix: Robust
Robust | ||
accidents | Coef. Std. Err. z P>|z| [95% Conf. Interval] | |
horsepower | .007671 .0013068 5.87 0.000 .0051096 .0102324 | |
x1 | .2045703 .047727 4.29 0.000 .1110271 .2981135 | |
x2 | .1432927 .0392774 3.65 0.000 .0663104 .220275 | |
_cons | -2.036695 .3157527 -6.45 0.000 -2.655558 -1.417831 | |
To understand the impact of pure horsepower (holding underlying risky behavior constant) on our young males, we will use Stata's margins to estimate the expected number of accidents using observed horsepower and the expected number of accidents from giving each car 50 more units of horsepower:
. margins , at((asobserved)) at(horsepower = generate(horsepower + 50)) Predictive margins Number of obs = 1000 Model VCE : Robust Expression : Predicted number of events, predict() 1._at : (asobserved) 2._at : horsepower = horsepower + 50
Delta-method | ||
Margin Std. Err. z P>|z| [95% Conf. Interval] | ||
_at | ||
1 | .848863 .0332419 25.54 0.000 .7837101 .9140158 | |
2 | 1.245694 .1008422 12.35 0.000 1.048047 1.443341 | |
We find that the expected number of accidents using observed horsepower is 0.85 and that it increases to 1.25 if each car produces 50 more horsepower.
We can compute the effect of the 50-horsepower increases by contrasting these two estimates:
. margins , at((asobserved)) at(horsepower = generate(horsepower + 50)) contrast(at(r._at)) Contrasts of predictive margins Model VCE : Robust Expression : Predicted number of events, predict() 1._at : (asobserved) 2._at : horsepower = horsepower + 50
df chi2 P>chi2 | ||
_at | 1 21.76 0.0000 | |
Delta-method | ||
Contrast Std. Err. [95% Conf. Interval] | ||
_at | ||
(2 vs 1) | .3968306 .0850745 .2300876 .5635737 | |
We find that increasing horsepower by 50 increases the expected number of accidents per young man by 0.40 on average. (This Poisson model is nonlinear, so the amount of increase varies across young men.)
The above results would be of interest to insurance companies that want to judge the effect of increasing the horsepower of modern cars.
See the manual entry.
To learn more about margins, see its manual entry.
See New in Stata 18 to learn about what was added in Stata 18.