I am working with a logit model. I am interested in the percentage change in the probability of a positive outcome when the treatment variable is binary. Consider, for instance, the impact of being in a "Grade 2" job on the probability of being a smoker. "gradd2" is a dummy variable. Here is my model:
Code:
use http://www.stata-press.com/data/r15/smoking.dta, clear generate smoker = (cigs > 0) if !missing(cigs) logit smoker gradd2, nolog
Code:
margins, eydx(gradd2)
Question 1:
Theoretically, this quantity should be arrived at by estimating the relative change in predicted probabilities: DeltaP/P = [L(a*1 - cons) - L(a*0 - cons)] / L(a*smoker - cons), where a is the coefficient on smoker, cons is the constant term, and L denotes the logisitc function. However, this does not seem to be the case:
Code:
margins, expression((1/(1+exp(-1*_b[gradd2]-_b[_cons])) - 1/(1+exp(-0*_b[gradd2]-_b[_cons])))*(1+exp(-gradd2*_b[gradd2]-_b[_cons])))
The question is: what quantity exactly does "eydx" estimate after "logit"?
Question 2:
I now re-run the model, but I treat my gradd2 dummy explicitly as a factor variable:
Code:
logit smoker i.gradd2, nolog
Code:
margins, eydx(gradd2)
Thanks a lot!
0 Response to margins, eydx after logit
Post a Comment