Author
Programming Language
Abstract
esreg estimates the endogenous switching regression (the Roy model with two regimes): a probit selection equation and an outcome equation for each regime, by full-information maximum likelihood or by a two-step estimator whose variance is that of the whole procedure (stacked moments). It reports the treatment effects ATT, ATU and ATE and the selection on gains, kappa = rho1 sigma1 - rho0 sigma0, constant or heterogeneous in the covariates (kappa(x)), with standard errors from the influence functions of the whole procedure (the estimation of the parameters, the averaging over the units and their covariance), by observation, by cluster or through the survey design (svyset: the svy prefix for the likelihood, vce(svy) for the two-step). An augmented two-step adds Hermite terms, in both regimes or in one, when the conditional mean of the regime errors is not linear. A family of post-estimation commands checks the assumptions one by one: esrdiag (strength, variation and support of the selection equation), esrtest (specification of the index, sufficiency of the instruments, constant kappa, normality by regime, and a pseudo-difference-in-differences on the index), esrcurve (the effect by quantile group of the score), esrmte (the marginal treatment effect, parametric and semiparametric) and esrreport (a reading of the results and the route to report). A dialog box and help examples run from clickable links are included. The commands are validated against etregress, movestay, msat and a Python reference implementation, and their standard errors against brute-force influence functions. A technical note documents the model, the tests and the estimators; it is included as an ancillary file (esreg_technical_note.pdf).
Suggested Citation
Abdelkrim Araar, 2026.
"ESREG: Stata module to estimate the endogenous switching regression with heterogeneous selection on gains,"
Statistical Software Components
S459922, Boston College Department of Economics.
Handle:
RePEc:boc:bocode:s459922
Note: This module should be installed from within Stata by typing "ssc install esreg". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
Download full text from publisher
Corrections
All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s459922. See general information about how to correct material in RePEc.
If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.
We have no bibliographic references for this item. You can help adding them by using this form .
If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html .
Please note that corrections may take a couple of weeks to filter through
the various RePEc services.