{smcl}
{* 01Nov2002}{...}
{hline}
help for {hi:ivendog} {right:(SSC distribution 28 March 2003)}
{hline}

{title:Calculate Durbin-Wu-Hausman endogeneity test after {cmd:ivreg}}

{p 8 14}{cmd:ivendog} [{it:varlist}]

{p} {cmd:ivendog} is for use after {cmd:ivreg} or {cmd:ivreg2};
see help {help ivreg} or help {help ivreg2} (if installed).
The test is not valid with pweights, nor with the robust or cluster
options of the original estimator, and will not be performed 
in these circumstances.


{title:Description}

{p}{cmd:ivendog} computes a test for endogeneity in a regression estimated via
instrumental variables (IV), the null hypothesis for which states that an
ordinary least squares (OLS) estimator of the same equation would yield 
consistent estimates: that is, any endogeneity among the regressors 
would not have deleterious effects on OLS estimates. A rejection of the null 
indicates that endogenous regressors' effects on the estimates are meaningful, 
and instrumental variables techniques are required. The test was 
first proposed by Durbin (1954) and separately by Wu (1973) (his T4 
statistic) and Hausman (1978). This "Durbin-Wu-Hausman" (DWH) test is numerically 
equivalent to the standard "Hausman test" obtained using {help hausman} with the 
sigmamore option, in which both forms of the model must be estimated. Under the null, it is 
distributed Chi-squared with m degrees of freedom, where m is the number of 
regressors specified as endogenous in the original instrumental variables regression.

{p}The {cmd:ivendog} output also contains another test statistic: the "Wu-Hausman"
T2 statistic of Wu (1973). Hausman (1978) showed that the test could be
calculated straightforwardly through the use of auxiliary regressions.
The test statistic, under the null, is distributed F(m,N-k), 
where m is the number of regressors specified as endogenous in the original 
instrumental variables regression. A rejection indicates that the instrumental 
variables estimator should be employed. See Davidson and MacKinnon 
(1993, p. 237-240) and Wooldridge (2000, p. 483-484). 

{p}If the constant was excluded from {cmd:ivreg} or {cmd:ivreg2}, it will be excluded 
from the auxiliary regression.

{p}As Davidson and MacKinnon (1993, p. 241-242) discuss, the test may be applied 
to a subset of the endogenous variables, maintaining those not specified as 
endogenous. In this form, the {it:varlist} contains those variables
which are to be tested, and the degrees of freedom for the test refer to the
number of variables listed.

{p}These tests may also be computed by the orthog option of {cmd:ivreg2}. 
Although {cmd:ivendog} may not be applied to robust nor cluster estimates,
{cmd:ivreg2} may also be used to perform a heteroskedasticity-robust 
form of the test in either context, as well as in the GMM context.

{p}The underlying computations for these tests are described in much greater
detail in Baum, Schaffer, and Stillman (2003).

{title:Examples}

{p 8 12}{inp:. use http://fmwww.bc.edu/ec-p/data/wooldridge/mroz, clear}{p_end}
{p 8 12}{inp:. ivreg lwage exper expersq (educ = motheduc fatheduc)}{p_end}
{p 8 12}{inp:. ivendog}{p_end}

{p 8 12}{inp:. ivreg lwage (exper educ = motheduc fatheduc huseduc)}{p_end}
{p 8 12}{inp:. ivendog}{p_end}
{p 8 12}{inp:. ivendog exper}{p_end}


{title:References}

{p 0 4}Baum, C. F., Schaffer, M. E., Stillman, S., 2003, Instrumental variables and
GMM: Estimation and testing. Stata Journal, Vol. 3, No. 1, pp. 1-31. Available as Working Paper no. 545, Boston College
Department of Economics. http://fmwww.bc.edu/ec-p/WP545.pdf

{p 0 4}Davidson, R. and MacKinnon, J., Estimation and Inference in Econometrics, 
1993, New York: Oxford University Press.

{p 0 4}Durbin, J., Errors in Variables, 1954, Review of the International
Statistical Institute, Vol. 22, pp. 23-32.

{p 0 4}Hausman, J., Specification Tests in Econometrics, 1978, Econometrica,
Vol. 46, No. 6, pp. 1251-1271.
        
{p 0 4}Wooldridge, J., Introductory Econometrics: A Modern Approach, 2000, New York:
South-Western College Publishing.

{p 0 4}Wu, D., 1973, Alternative Tests of Independence Between Stochastic Regressors
and Disturbances, Econometrica, Vol. 41, No. 4, pp. 733-750.

        
{title:Acknowledgements}

{p}We are grateful to Ronna Cong, Vince Wiggins, David Drukker, and an anonymous
reviewer for critical review of this module. 
Errors remaining are our own.


{title:Authors}

        Christopher F Baum, Boston College, USA
        baum@bc.edu

        Mark E. Schaffer, Heriot-Watt University, UK
        M.E.Schaffer@hw.ac.uk
        
        Steven Stillman, New Zealand Department of Labour
        Steven.Stillman@lmpg.dol.govt.nz
		

{title:Also see}

{p 1 14}Manual:  {hi:[R] ivreg}, {hi:[R] hausman}{p_end}
{p 0 19}On-line:  help for {help ivreg}, {help ivreg2} (if installed);
{help hausman} {p_end}
