Does anyone know how to get -weakivtest- to work with -ivreghdfe-?
The twitter post by the author's command suggest there is a way to make them work together:
Carolin Pflueger on Twitter: "Stata module weakivtest now supports noconstant. Useful if you want a robust pre-test for weak instruments, and are dealing with fixed effects via reghdfe. Thanks to @stroebel_econ for suggesting. @Ogoun" / Twitter
In my real example, I have a large dataset and am estimating -ivreghdfe- with three absorbed FE variables. Estimating it directly without considering high dimensional FE would be unfeasible.
Code:
. sysuse auto, clear (1978 automobile data) . ivreghdfe price weight (length=gear), absorb(rep78) cluster(rep78) (MWFE estimator converged in 1 iterations) IV (2SLS) estimation -------------------- Estimates efficient for homoskedasticity only Statistics robust to heteroskedasticity and clustering on rep78 Number of clusters (rep78) = 5 Number of obs = 69 F( 2, 4) = 4.13 Prob > F = 0.1064 Total (centered) SS = 568436416.2 Centered R2 = 0.0008 Total (uncentered) SS = 568436416.2 Uncentered R2 = 0.0008 Residual SS = 567997123 Root MSE = 2934 ------------------------------------------------------------------------------ | Robust price | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- length | 156.4453 339.3445 0.46 0.669 -785.7262 1098.617 weight | -1.899938 10.42416 -0.18 0.864 -30.84206 27.04218 ------------------------------------------------------------------------------ Underidentification test (Kleibergen-Paap rk LM statistic): 2.048 Chi-sq(1) P-val = 0.1524 ------------------------------------------------------------------------------ Weak identification test (Cragg-Donald Wald F statistic): 1.517 (Kleibergen-Paap rk Wald F statistic): 3.559 Stock-Yogo weak ID test critical values: 10% maximal IV size 16.38 15% maximal IV size 8.96 20% maximal IV size 6.66 25% maximal IV size 5.53 Source: Stock-Yogo (2005). Reproduced by permission. NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors. ------------------------------------------------------------------------------ Hansen J statistic (overidentification test of all instruments): 0.000 (equation exactly identified) ------------------------------------------------------------------------------ Instrumented: length Included instruments: weight Excluded instruments: gear_ratio Partialled-out: _cons nb: total SS, model F and R2s are after partialling-out; any small-sample adjustments include partialled-out variables in regressor count K ------------------------------------------------------------------------------ Absorbed degrees of freedom: -----------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs | -------------+---------------------------------------| rep78 | 5 5 0 *| -----------------------------------------------------+ * = FE nested within cluster; treated as redundant for DoF computation . weakivtest Weakivtest is a postestimation command after running ivreg2 or ivregress. .
Stata module weakivtest now supports noconstant. Useful if you want a robust pre-test for weak instruments, and are dealing with fixed effects via reghdfe.
In my real example, I have a large dataset and am estimating -ivreghdfe- with three absorbed FE variables. Estimating it directly without considering high dimensional FE would be unfeasible.
Comment