I am trying to estimate the Wald estimand and calculate standard errors using margins and suest, but I'm not able to exactly replicate what ivreg2 gets me or what I get by diving the reduced-form coefficient by the first-stage coefficient. Does anyone know why?
ivreg2 is available from SSC. Documentation: http://www.repec.org/bocode/i/ivreg2.html
(Note: the reason I'm using margins is: after I get this to work, I'm going to be simulating some other methods which will require margins, such as Edward Norton's (2022, NBER) guidance on calculating marginal effects on an outcome that has been transformed.)
I simulate some data:
Code:
clearall set obs 50000 set seed 10107 * randomly draw instrument values, idiosyncratic terms for each individual drawnorm Z replace Z=Z>0 drawnorm U0 drawnorm U1 * set parameters which shift potential outcomes scalar mu1 = 1 scalar mu0 = 0 * Potential outcomes gen Y0 = mu0 + U0 gen Y1 = mu1 + U1 gen tx = Y1 - Y0 // treatment effect sum tx * Treatment decision * let Utility = Y + Z * 1[A=1] * ie, Z reflects additional inducement (or deterence, if negative) for taking treatment gen relativeutility1 = Y1 - Y0 + Z gen A = relativeutility1 > 0 tab A, m * Outcome gen Y = Y1*A + Y0*(1-A)
I estimate the local average treatment effect (LATE) using ivreg2:
Code:
ivreg2 Y (A=Z) , r gen insample=e(sample)==1
Code:
reg Y Z if insample==1 estimates store RF scalar coef_RF = _b[Z] reg A Z if insample==1 estimates store FS scalar coef_FS = _b[Z] di coef_RF / coef_FS
Code:
suest RF FS, vce(robust) margins if insample==1, dydx(Z) expression(predict(equation(RF_mean)) / predict(equation(FS_mean)))
I would greatly appreciate it if anyone has any idea why this last technique using margins doesn't yield the same estimate as ivreg2 or dividing the reduced-form coefficient by the first-stage coefficient. Thank You!
Best,
Nate
0 Response to Difficulty with margins: Wald estimate discrepency between ivreg2 and margins
Post a Comment