Experimental draft package for high dimensional fixed effect estimation. Supports OLS and IV estimation.
Project description
PyFixest
This is a draft package (no longer highly experimental) for a Python clone of the excellent fixest package.
The package aims to mimic fixest
syntax and functionality as closely as possible.
Fixed effects are projected out via the PyHDFE package.
For a quick introduction, see the tutorial.
import pyfixest as pf
import numpy as np
from pyfixest.utils import get_data
data = get_data()
fixest = pf.Fixest(data = data)
# OLS Estimation
fixest.feols("Y~X1 | csw0(X2, X3)", vcov = {'CRV1':'group_id'})
fixest.fetch_model(0).tidy()
# Estimate Std. Error ... confint_lower confint_upper
#coefnames ...
#Intercept -3.941395 0.221365 ... 3.955276 -3.927514
#X1 -0.273096 0.165154 ... 0.283452 -0.262740
fixest.fetch_model(1).tidy()
# Estimate Std. Error ... confint_lower confint_upper
#coefnames ...
#X1 -0.260472 0.163874 ... 0.270748 -0.250196
PyFixest
also supports IV (Instrumental Variable) Estimation:
fixest = pf.Fixest(data = data)
fixest.feols("Y~ 1 | X2 + X3 | X1 ~ Z1", vcov = {'CRV1':'group_id'})
fixest.fetch_model(0).tidy()
# Model: Y~X1|X2+X3
# Estimate Std. Error ... confint_lower confint_upper
# coefnames ...
# X1 0.041142 0.201983 ... -0.028476 0.053807
Standard Errors can be adjusted after estimation, "on-the-fly":
# change SEs from CRV1 to HC1
fixest.vcov(vcov = "HC1").tidy()
# Estimate Std. Error ... confint_lower confint_upper
# fml coefnames ...
# Y~X1|X2+X3 X1 0.041142 0.167284 ... -0.030652 0.051631
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyfixest-0.7.2.tar.gz
(24.9 kB
view hashes)
Built Distribution
pyfixest-0.7.2-py3-none-any.whl
(27.2 kB
view hashes)