Thanks to Kit Baum, a new package called cfbinout is available on SSC.
cfbinout implements control function (two-stage residuals inclusion) estimation of binary outcome models, specifically logit, probit, and cloglog, as suggested in Wooldridge (2015). That is, in a first-stage the endogenous right-hand-side variables are regressed on the exogenous variables in the model. Subsequently, the (generalized) residuals from these regressions enter the second-stage regression as additional regressors. Regarding the implementation in Stata and Mata, cfbinout draws on Terza (2017, 2023). cfbinout complements the official Stata command ivprobit, twostep and the recent community-contributed command ivcloglog. Unlike ivprobit, twostep and ivcloglog, cfbinout allows for discrete/factor endogenous right-hand-side variables. For them, nonlinear first-stage models (default logit, alternatively probit) are estimated and generalized residuals are included in the second-stage regression, unless the option fslink(linear) is specified. With a probit link-function and the option fslink(linear), cfbinout probit is equivalent to ivprobit, twostep in terms of model estimation. An important difference is, however, that unless the option noresgenerate is specified, cfbinout takes the control functions (included residuals) into account in postestimation. The equivalence of cfbinout probit is even closer with cfprobit, a new official Stata command that was released for StataNow almost at the same time as cfbinout was completed.
References:
Terza, J.V. (2017). Two-Stage Residual Inclusion Estimation: A Practitioners Guide to Stata Implementation. The Stata Journal 17(4): 916–938.
Terza, J.V. (2023). Simpler Standard Errors for Two-Stage Optimization Estimators Revisited. The Stata Journal 23(4): 1057–1061.
Wooldridge, J.M. (2015). Control Function Methods in Applied Econometrics, The Journal of Human Resources 50(2), 420-445.
Best wishes,
Harald
cfbinout implements control function (two-stage residuals inclusion) estimation of binary outcome models, specifically logit, probit, and cloglog, as suggested in Wooldridge (2015). That is, in a first-stage the endogenous right-hand-side variables are regressed on the exogenous variables in the model. Subsequently, the (generalized) residuals from these regressions enter the second-stage regression as additional regressors. Regarding the implementation in Stata and Mata, cfbinout draws on Terza (2017, 2023). cfbinout complements the official Stata command ivprobit, twostep and the recent community-contributed command ivcloglog. Unlike ivprobit, twostep and ivcloglog, cfbinout allows for discrete/factor endogenous right-hand-side variables. For them, nonlinear first-stage models (default logit, alternatively probit) are estimated and generalized residuals are included in the second-stage regression, unless the option fslink(linear) is specified. With a probit link-function and the option fslink(linear), cfbinout probit is equivalent to ivprobit, twostep in terms of model estimation. An important difference is, however, that unless the option noresgenerate is specified, cfbinout takes the control functions (included residuals) into account in postestimation. The equivalence of cfbinout probit is even closer with cfprobit, a new official Stata command that was released for StataNow almost at the same time as cfbinout was completed.
References:
Terza, J.V. (2017). Two-Stage Residual Inclusion Estimation: A Practitioners Guide to Stata Implementation. The Stata Journal 17(4): 916–938.
Terza, J.V. (2023). Simpler Standard Errors for Two-Stage Optimization Estimators Revisited. The Stata Journal 23(4): 1057–1061.
Wooldridge, J.M. (2015). Control Function Methods in Applied Econometrics, The Journal of Human Resources 50(2), 420-445.
Best wishes,
Harald
