AP F-stat . . . one more time!

One more correction here folks.  If you follow our prescriptions you won’t get the degrees of freedom for the F-stat right.  ivreg2 gets this right for you (thanks to Jenny Hunt for pointing out this discrepancy and to Mark Schaffer from the ivreg team for resolving it).

But if you want to impress your friends and do it longhand . . .

Suppose you have two endogenous variables x1 and x2, and you want the AP F-stat for x2.  There is also a third (exogenous) covariate x3 and you have q instruments, z1, z2, …, zq.  Using ivreg2 you would run

ivreg2 y (x1 x2 = z*) x3, ffirst

To do this manually in Stata, try:

local q = 3                      /* or whatever the number of your instruments is */

reg x1 z* x3

predict double x1hat

reg x2 x1hat x3

predict double x2res, resid

reg x2res z* x3

testparm z*

dis r(F)*(`q’/(`q’-1))

The testparm procedure in the second last line will produce an F-test with q numerator degrees of freedom.  But you lost one dof for partialling out x1 (you need one of your q instruments to identify x1), so your correct number of dof is q-1.  The last line in the code fixes the dofs, and should produce the same answer you get from ivreg2.  If you follow the procedure in MHE, p. 217-18 by first partialling out x3 from the instruments you wouldn’t have an x3 anymore in your last regression you run for the F-test.  In this case, you will also have to fix the denominator dofs for the F-test, to adjust for the dofs lost due to the exogenous covariates.

SP

Published . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>