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.
Context
At the moment,
PyFixest
's standard errors differ slightly fromfixest
defaults (explainer here).This is because
fixef_k = "nested"
is not implemented in PyFixest - in contrast to fixest, the default argument of thessc()
function isfixef_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.
Task
Add the following variants to the
fixef_k
function argument of the https://github.com/py-econometrics/pyfixest/blob/a98a9b92dfead109ab96c01f494c2d194c516165/pyfixest/utils/utils.py#L11 function:fixef_k="nested"
fixef_k="full"
Add unit tests against
fixest
.Change the default to
ssc(fixef_k = "nested")
, mirroringfixest
.Note that this introduces a breaking change to the PyFixest results - all default standard errors will deviate slightly.