Skip to content

Inference: Support fixef_k = "nested" for small sample correction in ssc() for identical standard errors with fixest #501

@s3alfisc

Description

@s3alfisc

Context

At the moment, PyFixest's standard errors differ slightly from fixest defaults (explainer here).

This is because fixef_k = "nested" is not implemented in PyFixest - in contrast to fixest, the default argument of the ssc() function is fixef_k = "none" instead of "nested".

Per the fixest docs, "fixef.K="nested" discards all coefficients of fixed effects nested within clusters" when computing the number of coefficients $k$ for small sample corrections, while "fixef.K="none" discards all fixed-effects coefficients".

For examples of what is meant by a fixed effect nested in a cluster, take a look at the fixest vignette.

Image

Image

Task

Add the following variants to the fixef_k function argument of the

function:

  • fixef_k="nested"
  • fixef_k="full"

Add unit tests against fixest.

Change the default to ssc(fixef_k = "nested"), mirroring fixest.

Note that this introduces a breaking change to the PyFixest results - all default standard errors will deviate slightly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeBreaking Changes to PyFixest Functionality or User-Facing APIsenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions