Skip to content

regression result fvalue assumptions ? sandwiches ? #1104

Closed

Description

@josef-pkt

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.

Activity

  1. josef-pkt commented on Oct 6, 2013

    @josef-pkt
    MemberAuthor

    (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.

  2. josef-pkt commented on Dec 10, 2013

    @josef-pkt
    MemberAuthor

    BTW fvalue is the Wald test using robust is in every "modern" text book, Wooldridge, Stock/Watson

  3. josef-pkt commented on Jun 18, 2014

    @josef-pkt
    MemberAuthor

    As additional information:
    anovalm uses f_test i.e the wald test, not the ssr comparison, so the test is correct with robust standard errors.

  4. bashtage commented on Jul 31, 2026

    @bashtage
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions