py-econometrics / pyfixest

Fast High-Dimensional Fixed Effects Regression in Python following fixest-syntax
https://py-econometrics.github.io/pyfixest/pyfixest.html
MIT License
118 stars 27 forks source link

numpy-api: Move fixed effects demeaning inside of `Feols` and `Feiv` classes #454

Open s3alfisc opened 1 month ago

s3alfisc commented 1 month ago

Currently, the fixed effects demeaning takes place outside of Feols and Fepois.

With this PR, we move the fixed effects demeaning "into" Feols / Fepois. Note that this is already the case for Fepois.

Dropping of fixed effects singletons will also be moved into Feols.

Therefore, we need to add the following function arguments to Feols / Fepois:

Note that for IV, we need to demean both the design matrix X (including the exog + endog variables) and Z (including exog vars + instruments).