py-econometrics / pyfixest

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

Fix bug with negative fixef #425 #426

Closed s3alfisc closed 5 months ago

s3alfisc commented 5 months ago

Fixes #425 . Reason: demean algo requires positive ints.

The below now runs without crashing:

%load_ext watermark
%watermark --iversions
%load_ext autoreload
%autoreload 2

import pyfixest as pf
from lets_plot import *
data = pf.get_data().dropna()

data.loc[4, "f1"] = -1
data.head()
fit = pf.feols("Y ~ X1 | f1", data=data)