Probably this question has no sense but I am really confused and I need help.
I have a panel data model.
I ran a fixed effect negative binomial regression for a variable which indicates the number of years a government stays in office.
How may I compute the "amount" of the influence of an independent dummy variable over the dependent? and for a non-dummy?
Why "Margins,dydx(_all)" in Stata returns the same coefficients of the Fixed Effect model?
Solved – fixed effect and marginal effect in negative binomial
fixed-effects-modelmarginal-effectnegative-binomial-distribution
Best Answer
In the panel NB model, the expected number of events is
$$E[y \vert x]=\exp\{\alpha +\beta x + \gamma_i\}.$$
By default,
margins, dydx(.)
gives you the effect on the index function (the part inside $\exp\{.\}$), so you just get back the reported coefficients since the index function is linear.By altering the
predict()
option, you can get average marginal effects (AMEs) on the number of events, which is the average of the derivatives of the expression above with respect to $x$:$$AME =\frac{\sum_i^N\exp\{\alpha +\beta \cdot x_{it} + \gamma_i\} \cdot \beta}{N}$$
However, Stata will evaluate each derivative as if the fixed effect $\gamma_i$ was zero for all $i$. This happens because the
xtnbreg, fe
model is estimated by a method known as conditional maximum likelihood. Here the FE for each individual are conditioned out of the likelihood function. This means that they are not available to be plugged in since these nuisance parameters are eliminated to make estimation easier/feasible. However, I believe they sum up to zero, so the AME can be interpreted as the AME as if everyone had the typical FE and their own covariates. I cannot find this explicitly stated in the documentation, so take that with a grain of salt.Here's some Stata code showing this:
I am using a logarithmic offset for miles flown to make events proportional to miles flown, and treating inprog as if it was continuous rather than binary (since that is more similar to your situation). The AME is 9.7 fewer injury incidents from participating in an experimental safety training program across all airlines given their miles flown history.
You can also still interpret the index function coefficient as a kind of semi-elasticity. Here a one unit change in inprog is associated with a $100 \cdot \beta=-9.84 \%$ drop in events. This does not require you to fix $\gamma_i=0$.