You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model F statistic tests the wrong hypothesis when the constant is implied by dummies #780
When the constant is implied by regressors rather than included as a column of ones (for example, two dummies that sum to one), the model F statistic does not test "all coefficients except the intercept are zero".
importnumpyasnpimportpandasaspdfromlinearmodels.ivimportIV2SLSrng=np.random.default_rng(0)
n=200g=np.arange(n) %2x=pd.DataFrame(
{"d0": (g==0).astype(float), "d1": (g==1).astype(float), "x": rng.standard_normal(n)}
)
y=1.0+0.3*x.d1+0.2*x.x+rng.standard_normal(n)
res=IV2SLS(y, x, None, None).fit(cov_type="unadjusted")
res.f_statistic# 227.68 on 3 df: tests d0 = d1 = x = 0, which includes the intercept
The test of no explanatory power beyond the intercept is d0 = d1 and x = 0. Its Wald statistic is 10.77 on 2 df.
The system models detect the constant in this case, but drop an arbitrary dummy, so the F statistic tests "the other dummy and the slopes are zero" (25.76 against 33.44 for the correct test in one example). The panel results use the same logic.
Deferred from 7.1. The fix should either find the implied intercept and test the right restrictions, or document that the model F statistic needs an explicit constant.
Activity
TST: Test the implicit-constant F statistic of IVGMMCUE and IVJIVE
DOC: Add bashtage#858, bashtage#859 and bashtage#862 to the 7.2 notes