Hello Statalist,
I am trying to manually predict the effect of a 1 unit increase in a predictor variable after a poisson regression.
To illustrate what I mean, I've done it (correctly) for a probit regression as follows:
For the poisson regression, I attempt to repeat as follows:
I assume there is something wrong with my understanding of the distribution function for poisson? If so, what is the appropriate code?
Thanks!
I am trying to manually predict the effect of a 1 unit increase in a predictor variable after a poisson regression.
To illustrate what I mean, I've done it (correctly) for a probit regression as follows:
Code:
use http://www.ats.ucla.edu/stat/stata/dae/binary.dta, clear probit admit gre gpa i.rank margins, dydx(gre) ///gives same results as manual dydx prediction below predict xb, xb gen yhat = (normal(xb)) replace gre = gre +1 predict xb_2, xb gen yhat_2 = (normal(xb_2)) gen dydx = yhat_2 - yhat collapse dydx ///gives same results as margins dydx prediction above list dydx
I assume there is something wrong with my understanding of the distribution function for poisson? If so, what is the appropriate code?
Code:
use http://www.ats.ucla.edu/stat/stata/dae/poisson_sim, clear poisson num_awards math i.prog margins, dydx(math) predict xb , xb gen yhat = (lnfactorial(xb)) replace math = math + 1 predict xb_2 , xb gen yhat_2 = (lnfactorial(xb_2)) gen dydx = yhat_2 - yhat collapse dydx list dydx
Comment