Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
vwiggins@stata.com (Vince Wiggins, StataCorp) |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: conditional marginal effects after the Heckman two-step sample |

Date |
Thu, 30 Dec 2010 14:04:53 -0600 |

Norbert Wilson <WILSONL@auburn.edu> is having trouble getting -margins- to estimate the marginal effect of a covariate on the conditional expectation of his dependent variable -- E(y | y observed) -- after estimation using -heckman- with the -twostep- option. Norbert writes that he is typing, . margins, dydx (x) predict (ycond) and that Stata "does not recognize this command". Norbert also notes that he was able to obtain estimates of these marginal effects using -mfx-. I am not sure what "does not recognized" means, but I can see two possible problems. One, Norbert's command is not technically legal. He should remove the spaces between his option names and their associated open parentheses, . margins, dydx(x) predict(ycond) I say technically, because sometimes Stata will tolerate these spaces and sometimes it will not. Either way, they are not supported. Two, and more likely, -margins- is returning the following error after Norbert's command, predict option ycond not appropriate with margins r(322); Had Norbert fit his Heckman model using the default MLE, -margins- would have been willing to estimated the marginal effects. The reason it refuses after twostep estimation is that estimates of sigma (the root of the variance of the disturbances) and rho (the correlation between the disturbances of the model and selection equations) are required estimate the conditional expectations of the dependent variable. The twostep estimator produces estimates of these two values but does not estimate the variance of rho or the covariance of rho and sigma with the other parameters. So, the standard errors of the conditional expectations would ignore these sources of variation. These variances and covariances simply are not part of the twostep estimator. -margins- refuses to proceed, knowing that it does not have estimates of all of the sources of variation in the conditional expectations. -mfx- enforced this requirement differently. It provided point estimates, but not standard errors. When the Heckman model is fit by MLE, the variance and covariances of sigma and rho are estimated and both -margins- and -mfx- will produce point estimates and standard errors. Norbert can instruct -margins- to perform its calculations ignoring its inability to identify all sources of variation by adding the -force- option to his command. The point estimates are fine, but the SEs ignore that rho and sigma are estimated. If Norbert wishes to compare results from -margins- and -mfx-, he should add the -atmeans- option to -margins-. By default, -margins- computes average marginal effects not marginal effects at the means (or specified values). -mfx- could compute only the latter. -- Vince vwiggins@stata.com * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: conditional marginal effects after the Heckman two-step sample***From:*"Norbert Wilson" <WILSONL@auburn.edu>

- Prev by Date:
**Re: st: predicted values in svy glm l(log) f(poisson)** - Next by Date:
**st: new version of rct_minim available on SSC** - Previous by thread:
**st: estat overid & sample weights** - Next by thread:
**Re: st: conditional marginal effects after the Heckman two-step sample** - Index(es):