I am trying to calculate the average marginal effects for the Chamberlain-Mundlak Correlated Random Effects probit model.
I can do this in several ways (see below). The one that is giving me trouble is the panel random effects probit where the RHS variables are augmented with $\bar x_i$, the average of $x_{it}$ for each panel. I thought the AMEs from this model, appropriately rescaled, would agree with all the other equivalent ways of doing it, but they do not. If anything, the unscaled version seems best.
I would like to get some intuition on why this is not the case (or what I am doing wrong).
Moreover, my scaled index function coefficients in (a) (-.08865639 and -.02240692) do not agree with the pooled probit ones in (3) (-.1173749 and -.0288098).
Here's my Stata code:
The relevant part of the results is:
I would have expected (1) to be off since it sets the FE to zero. I would like to figure out how to match (6) with (2)-(5).
I can do this in several ways (see below). The one that is giving me trouble is the panel random effects probit where the RHS variables are augmented with $\bar x_i$, the average of $x_{it}$ for each panel. I thought the AMEs from this model, appropriately rescaled, would agree with all the other equivalent ways of doing it, but they do not. If anything, the unscaled version seems best.
I would like to get some intuition on why this is not the case (or what I am doing wrong).
Moreover, my scaled index function coefficients in (a) (-.08865639 and -.02240692) do not agree with the pooled probit ones in (3) (-.1173749 and -.0288098).
Here's my Stata code:
Code:
set more off estimates drop _all copy https://mitpress.mit.edu/sites/default/files/titles/content/wooldridge/statafiles.zip statafiles.zip, replace unzipfile statafiles.zip, replace use "lfp.dta", clear xtset id period // balanced panel /* Calculate means of covariates for each id */ foreach var of varlist kids lhinc { egen `var'bar = mean(`var'), by(id) } /* (1) FE Panel Logit */ qui xtlogit lfp kids lhinc i.period, fe nolog margins, dydx(kids lhinc) post estimates store m1, title("Panel Logit FE") // these set the FE to its average of zero /* (2) FE Linear Panel Model */ qui xtreg lfp kids lhinc i.period, fe cluster(id) margins, dydx(kids lhinc) post estimates store m2, title("Panel FE") /* (3) Pooled Probit (Inefficient Relative to CRE) */ probit lfp kids lhinc kidsbar lhincbar educ i.black c.age##c.age i.period, cluster(id) nolog margins, dydx(kids lhinc) post estimates store m3, title("Pooled Probit") /* (4) GEE may be more efficient */ qui xtgee lfp kids lhinc kidsbar lhincbar educ i.black c.age##c.age i.period, /// fam(bin) link(probit) corr(exch) robust nolog margins, dydx(kids lhinc) post estimates store m4, title("Panel GEE") /* (5) GLM */ qui glm lfp kids lhinc kidsbar lhincbar educ i.black c.age##c.age i.period, /// fam(bin) link(probit) cluster(id) nolog margins, dydx(kids lhinc) post estimates store m5, title("GLM") /* (6) Chamberlain-Mundlak Device Style Correlated Random Effects Probit */ /* ("Style" means also adding other time-invariant variables) */ qui xtprobit lfp kids lhinc kidsbar lhincbar educ i.black c.age##c.age i.period, re nolog /* (a) Scaled coefficients to compare with pooled index function probit ones in (3) */ di (1/sqrt(1 + e(sigma_u)^2))*_b[kids] di (1/sqrt(1 + e(sigma_u)^2))*_b[lhinc] local factor = 1/sqrt(1 + e(sigma_u)^2) // scale factor /* (b) CRE MEs Attempt #1 */ margins, expression(normalden(xb())*(_b[kids])*(1/sqrt(1 + e(sigma_u)^2))) force margins, expression(normalden(xb())*(_b[lhinc])*(1/sqrt(1 + e(sigma_u)^2))) force /* (c) CRE MEs Attempt #2 */ margins, dydx(kids lhinc) post estimates store m6, title("CRE") /* (d) CRE MEs Attempt #3 */ nlcom (kids:_b[kids]*`factor') (lhinc:_b[lhinc]*`factor') esttab *, se mtitle modelwidth(15)
The relevant part of the results is:
Code:
. qui xtprobit lfp kids lhinc kidsbar lhincbar educ i.black c.age##c.age i.period, re nolog . . /* (a) Scaled coefficients to compare with pooled index function probit ones in (3) */ . di (1/sqrt(1 + e(sigma_u)^2))*_b[kids] -.08865639 . di (1/sqrt(1 + e(sigma_u)^2))*_b[lhinc] -.02240692 . local factor = 1/sqrt(1 + e(sigma_u)^2) // scale factor . . /* (b) CRE MEs Attempt #1 */ . margins, expression(normalden(xb())*(_b[kids])*(1/sqrt(1 + e(sigma_u)^2))) force (note: expression is a function of possibly stochastic quantities other than e(b)) Predictive margins Number of obs = 28,315 Model VCE : OIM Expression : normalden(xb())*(_b[kids])*(1/sqrt(1 + e(sigma_u)^2)) ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | -.0061709 .0011396 -5.41 0.000 -.0084045 -.0039372 ------------------------------------------------------------------------------ . margins, expression(normalden(xb())*(_b[lhinc])*(1/sqrt(1 + e(sigma_u)^2))) force (note: expression is a function of possibly stochastic quantities other than e(b)) Predictive margins Number of obs = 28,315 Model VCE : OIM Expression : normalden(xb())*(_b[lhinc])*(1/sqrt(1 + e(sigma_u)^2)) ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | -.0015596 .0007353 -2.12 0.034 -.0030008 -.0001185 ------------------------------------------------------------------------------ . . /* (c) CRE MEs Attempt #2 */ . margins, dydx(kids lhinc) post Average marginal effects Number of obs = 28,315 Model VCE : OIM Expression : Pr(lfp=1), predict(pr) dy/dx w.r.t. : kids lhinc ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- kids | -.0301539 .0053261 -5.66 0.000 -.0405928 -.0197149 lhinc | -.0076211 .0035696 -2.13 0.033 -.0146174 -.0006247 ------------------------------------------------------------------------------ . estimates store m6, title("CRE") . . /* (d) CRE MEs Attempt #3 */ . nlcom (kids:_b[kids]*`factor') (lhinc:_b[lhinc]*`factor') kids: _b[kids]*.2233101065698412 lhinc: _b[lhinc]*.2233101065698412 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- kids | -.0067337 .0011894 -5.66 0.000 -.0090648 -.0044025 lhinc | -.0017019 .0007971 -2.13 0.033 -.0032642 -.0001395 ------------------------------------------------------------------------------ . . esttab *, se mtitle modelwidth(15) ------------------------------------------------------------------------------------------------------------------------------ (1) (2) (3) (4) (5) (6) Panel Logit FE Panel FE Pooled Probit Panel GEE GLM CRE ------------------------------------------------------------------------------------------------------------------------------ kids -0.0507* -0.0389*** -0.0389*** -0.0373*** -0.0389*** -0.0302*** (0.0254) (0.00917) (0.00892) (0.00932) (0.00892) (0.00533) lhinc -0.0145*** -0.00894 -0.00954* -0.00917 -0.00954* -0.00762* (0.00150) (0.00459) (0.00475) (0.00491) (0.00475) (0.00357) ------------------------------------------------------------------------------------------------------------------------------ N 5275 28315 28315 28315 28315 28315 ------------------------------------------------------------------------------------------------------------------------------ Standard errors in parentheses * p<0.05, ** p<0.01, *** p<0.001
Comment