help ivregress2

-------------------------------------------------------------------------------

Title

ivregress2 -- Exports first and second-stage results similar to ivregress.

Syntax

ivregress2 estimator depvar [varlist1] (varlist2 = varlist_iv) [if] [in] [weight] [, options]

Description

ivregress2 provides a fast and easy way to export both the first-stage and the second-stage results similar to ivregress, on which it is based.

Options

ivregress2 accepts the syntax and the options for ivregress (circa Stata 11) with the following change:

+----------------+ ----+ Changed option +---------------------------------------------------

first saves the estimates "first" and "second".

Examples

* export them (with table-making programs of your choice)

ivregress2 2sls mpg weight (length=displacement), first est restore first outreg2 using myfile, cttop(first) replace est restore second estat firststage local fstat `r(mineig)' estat endogenous local p_durbin `r(p_durbin)' outreg2 using myfile, cttop(second) excel adds(IV F-stat, `fstat', Durbin pval, `p_durbin')

* You may fit 2SLS, LIML, GMM, etc. See ivregress.

webuse hsng2, clear ivregress2 2sls rent pcturban (hsngval = faminc i.region), small ivregress2 liml rent pcturban (hsngval = faminc i.region) ivregress2 gmm rent pcturban (hsngval = faminc i.region)

* use version control to make it future-proof against Stata 13 and beyond

version 12: ivregress2 2sls mpg weight (length=displacement), first

Resources

ivregress postestimation estat endogenous perform tests of endogeneity estat firststage report "first-stage" regression statistics estat overid perform tests of overidentifying restrictions

Remarks

This is actually an old program that I used personally. I hope this will put this issue to rest.

Alternatively, hit the BREAK button or the red X button on Stata after the first-stage appears. This solution should work with xtivreg and xtivreg2 also. See below for the original posting.

http://www.stata.com/statalist/archive/2012-05/msg00885.html

Acknowledgements

ivregress2 was cloned from the official ivregress. This is meant to be a supplement, not a replacement. Thanks to Stata Corporation for their open-source programming.

Etiology: 2010/03/16 2:35PM CST : ivregress2.ado prepared for personal use 2012/05/21 6:15PM CST : ivregress2.hlp prepared for public use 2012/05/21 23:22:45 UTC : emailed to SSC 2012/06/17 Unkown hour : uploaded to SSC 27 days later, don't ask me 2013/01/23 6:53PM CST : ivregress2.hlp modified in response to inquiry 2013/01/24 8:50AM CST : ivregress2.hlp modified in response to Kit Bau > m Incidentally, the difference between CST and UTC is 5 hours during DST.

Author

Roy Wada roywada@hotmail.com