Skip to content

ddof for models #2799

Open
Open

Description

@josef-pkt

This is for a generic argument to adjust the df_resid and df_model

The main use case is ddof for absorbed variables, e.g. demeaned exog and endog.
See #2568 and #2774

Absorbing only works for linear model, but we might be doing something similar for discrete, GLM and other nonlinear/nongaussian models. E.g. absorb into offset and adjust df_resid.
However, in those cases the default is use_t=False which doesn't depend on df_resid, but it's used in some small sample corrections.

For interpretation and example for OLS see #2774, with possibility for unit tests against Stata's areg to check definition of extras. The main comparison I used is OLS with dummies versus OLS absorbed with ddof.

This can be a separate PR from #2774

see #285 for connection to cov_type, cov_params

Activity

  1. josef-pkt commented on Jun 12, 2016

    @josef-pkt
    MemberAuthor

    I thought I already had a branch for ddof in OLS, but apparently not
    maybe I never converted my development script to code in statsmodels

    https://github.com/josef-pkt/misc/blob/olsabsorb/notebooks/ex_olsabsorb.ipynb
    in 65 changes df_resid and df_model directly before fitting
    AFAIR, everything agrees between full OLS model and absorbed OLS model with ddof except for those that need the fixed effects directly, and hypothesis test against the constant-only Null model, including fvalue and rsquared.

    The constant-only Null model includes the absorbed fixed effects, so fvalue and rsquared or LRNull and similar are defined with respect to a fixed-effect-intercepts-only Null model, or whatever else has already been absorbed. e.g. the Null hypothesis for fvalue and LRNull is that included explanatory variables except constant have zero effect/coefficients.

  2. added this to the 0.14 milestone on Sep 24, 2021
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