Skip to content

ENH/DOC: reset_test #3690

Open
Open

Description

@josef-pkt

A general specification test mainly for functional form, extends easily to GLM and other models, either with an auxiliary regression or a variable addition score test.
similar to link_test #1479

see #2041 (comment)

I thought I already had a function, but it looks like it's misplaced and not in api, docs
https://github.com/statsmodels/statsmodels/blob/master/statsmodels/stats/outliers_influence.py#L86
2 unit tests against gretl in "statsmodels\regression\tests\test_glsar_gretl.py"
I guess it should be in diagnostics, and not in outliers_influence

related
#5388 tools for binning, ...

Activity

  1. josef-pkt commented on Dec 3, 2018

    @josef-pkt
    MemberAuthor

    There are some other issues on variable addition score tests, e.g. #3916

    a comment from the Stata list on ovtest versus linktest
    https://www.statalist.org/forums/forum/general-stata-discussion/general/1342616-linktest-and-ovtest-produce-conflicting-results

    """
    To be honest, I think Stata does a really poor job with these tests (I hope someone from StataCorp reads this!). There are several points to be made here:

    • As far as I understand, -ovtest- is a RESET test. Therefore it is a check of the correct specification of the conditional mean; conditioning on the set of variables being used. Therefore, it is not a test for omitted variables as the name suggests; this is very confusing and that may explain Rich's comment in qqplot #2.

    • The particular form of the RESET that is implemented in -ovtest- does not allow the user to choose the number of powers to include and does not allow the use of robust standard errors. These are serious limitations.

    • Form what I read in the manual, -linktest- is a simplified version of the RESET. It allows the use of robust standard errors but the number of powers is again fixed. However, it is not a true RESET test and I guess it will have less power; to put it differently, I am not aware of any optimal properties for this form of the test.

    • More important, I find it shocking that the manual says that it is a test of the specification of the dependent variable. The choice of dependent variable is dictated by the substantial question that we are interested in; no statistical test can check that!

    Given the drawback of these procedures, I suggest that you simply run the RESET "by hand", using a suitable number of powers (just squares or squares and cubes) and with appropriate standard errors.
    ""
    Joao Santos Silva

  2. added this to the 0.11 milestone on Dec 3, 2018
  3. josef-pkt commented on Dec 3, 2018

    @josef-pkt
    MemberAuthor

    related #1479 link test with example using new score_test

  4. modified the milestones: 0.11, josef on Oct 5, 2019
  5. josef-pkt commented on Dec 31, 2019

    @josef-pkt
    MemberAuthor

    not clear to me right now (I don't remember)

    In GLM and discrete with variable augmentation reset test
    Do we use powers of fittedvalues (predicted endog) or of the linear prediction linpred?

    (I used fittedvalues in my uncommitted code, but maybe it should be linpred, or optionally both?)

    (another thought: we could also use WLS to check locally with the augmented model keeping weights at the "null", i.e. original specification.)

  6. josef-pkt commented on Oct 3, 2020

    @josef-pkt
    MemberAuthor

    Lipsitz, Stuart R., Garrett M. Fitzmaurice, and Geert Molenberghs. 1996. “Goodness-of-Fit Tests for Ordinal Response Regression Models.” Journal of the Royal Statistical Society. Series C (Applied Statistics) 45 (2): 175–90. https://doi.org/10.2307/2986153.

    uses a binned indicator function in score or wald test for variable addition as gof test
    that's close or identical to what I have in my reset code

    Fagerland, Morten W., and David W. Hosmer. 2016. “Tests for Goodness of Fit in Ordinal Logistic Regression Models.” Journal of Statistical Computation and Simulation 86 (17): 3398–3418. https://doi.org/10.1080/00949655.2016.1156682.
    compare 3 approaches for gof testing including Lipsitz et al

    Fagerland, Morten W., and David W. Hosmer. 2017. “How to Test for Goodness of Fit in Ordinal Logistic Regression Models:” The Stata Journal, September. https://doi.org/10.1177/1536867X1701700308.
    describes Stata user function for gof including Wald-Lipsitz LR-Lipsitz.

  7. josef-pkt commented on Oct 28, 2021

    @josef-pkt
    MemberAuthor

    ??? still no comment about where my code is :(

    #1479 (comment)
    has link to https://gist.github.com/josef-pkt/f20abdbd360c2e549f73e98844f5d2c4

    I don't remember where my functions for exog_to_test construction are.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions