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
regression result fvalue assumptions ? sandwiches ? #1104
In IV2SLS, the inherited fvalue is not the same as the value calculated from the f_test.
The result from the f_test agree with Stata, fvalue of the results instance doesn't.
The results instance uses fvalue = self.mse_model/self.mse_resid
the Wald test fvalue is
restriction = np.eye(len(res1.params))
res_f = res1.f_test(restriction[:-1]) # without constant
res_f.fvalue
It looks like there are two different definitions for fvalue used that coincide in the linear model.
Which hypothesis test is the fvalue of the regression result? Is it a Likelihood Ratio test?
I guess (not checked yet), the same discrepancy will occur if we use sandwich, robust cov_params in the linear model.
update
The same is true for LL-Null versus Wald test in discrete models:
Stata reports in summary (in a Poisson example) LR chi2(1) = 0.00 after non-robust, and Wald chi2(1) = 0.00 after robust covariance (cov_cluster in example)
need to adjust also the label in summary() in discrete_model
for implementation:
In some versions of negative binomial we have an extra parameter. In the Wald test this needs to be excluded additional to the constant.
Fixed by commit 25e9516: RegressionResults.fvalue now branches to self.f_test() (Wald test) under robust covariance instead of the homoscedasticity-only mse_model/mse_resid ratio, tested in test_robustcov.py::test_fvalue. The bundled-in discrete-model "LLR" vs "Wald" summary-label complaint is a distinct, still-unaddressed cosmetic issue - happy to file that separately if it matters, but closing this one as fixed for the core fvalue bug.
Activity
josef-pkt commentedon Oct 6, 2013
(according to my inhouse expert)
fvalue is the Wald test and the sum of squares formula is only valid under homoscedasticity.
We need to go back to f_test under other assumptions.
Not clear, IV2SLS (without "robust") assumes homoscedasticity, I think.
ENH/BUG: add IVRegressionResults, fix fvalue, see statsmodels#1104
josef-pkt commentedon Dec 10, 2013
BTW fvalue is the Wald test using robust is in every "modern" text book, Wooldridge, Stock/Watson
ENH/BUG: add IVRegressionResults, fix fvalue, see statsmodels#1104
josef-pkt commentedon Jun 18, 2014
As additional information:
anovalm uses
f_testi.e the wald test, not the ssr comparison, so the test is correct with robust standard errors.ENH/BUG: add IVRegressionResults, fix fvalue, see statsmodels#1104
bashtage commentedon Jul 31, 2026
Fixed by commit 25e9516: RegressionResults.fvalue now branches to self.f_test() (Wald test) under robust covariance instead of the homoscedasticity-only mse_model/mse_resid ratio, tested in test_robustcov.py::test_fvalue. The bundled-in discrete-model "LLR" vs "Wald" summary-label complaint is a distinct, still-unaddressed cosmetic issue - happy to file that separately if it matters, but closing this one as fixed for the core fvalue bug.