Hi,

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
To compute the relative change in the probability of smoker, I type:

Code:
margins, eydx(gradd2)
On average, individuals in gradd2 jobs are 33.4 percent more likely to be smokers.


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])))
Now, it appears that individuals in gradd2 jobs are 34.4 percent more likely to be smokers.

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
Now, the "margins" command returns a different value (30.7 percent more likely):

Code:
margins, eydx(gradd2)
Why is this the case?


Thanks a lot!