Metadata-Version: 2.1
Name: pyfixest
Version: 0.6
Summary: Experimental draft package for high dimensional fixed effect estimation. Supports OLS and IV estimation.
Home-page: https://s3alfisc.github.io/pyfixest/
License: MIT
Author: Alexander Fischer
Author-email: alexander-fischer1801@t-online.de
Requires-Python: >=3.8,<3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: PyHDFE (>=0.1.1,<0.2.0)
Requires-Dist: formulaic (>=0.6.0,<0.7.0)
Requires-Dist: matplotlib (>=3.7,<4.0)
Requires-Dist: numpy (>=1.18)
Requires-Dist: pandas (>=1.4,<2.0)
Requires-Dist: pytest (>=7.0.0,<8.0.0)
Requires-Dist: scipy (>=1.0.0,<2.0.0)
Requires-Dist: wildboottest (>=0.1.10)
Project-URL: Repository, https://github.com/s3alfisc/pyfixest
Description-Content-Type: text/markdown

## PyFixest

[![PyPI - Version](https://img.shields.io/pypi/v/pyfixest.svg)](https://pypi.org/project/pyfixest/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyfixest.svg)
![PyPI - Status](https://img.shields.io/pypi/status/pyfixest.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pyfixest)
[![image](https://codecov.io/gh/s3alfisc/pyfixest/branch/master/graph/badge.svg)](https://codecov.io/gh/s3alfisc/pyfixest)

This is a draft package (highly experimental!) for a Python clone of the excellent [fixest](https://github.com/lrberge/fixest) package.

Fixed effects are projected out via the [PyHDFE](https://github.com/jeffgortmaker/pyhdfe) package.

For a quick introduction, see the [tutorial](https://s3alfisc.github.io/pyfixest/tutorial/).

```python
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.summary()
# ###
#
# Model:  OLS
# Dep. var.:  Y
# Inference:  {'CRV1': 'group_id'}
# Observations:  1998
#
#            Estimate  Std. Error    t value     Pr(>|t|)
# Intercept -3.941395    0.221365 -17.804976 2.442491e-15
#        X1 -0.273096    0.165154  -1.653580 1.112355e-01
# ---
# ###
#
# Model:  OLS
# Dep. var.:  Y
# Fixed effects:  X2
# Inference:  {'CRV1': 'group_id'}
# Observations:  1998
#
#     Estimate  Std. Error   t value  Pr(>|t|)
# X1 -0.260472    0.163874 -1.589472  0.125042
# ---
# ###
#
# Model:  OLS
# Dep. var.:  Y
# Fixed effects:  X2+X3
# Inference:  {'CRV1': 'group_id'}
# Observations:  1998
#
#     Estimate  Std. Error  t value  Pr(>|t|)
# X1   0.03975    0.107003 0.371481  0.713538
# ---


# IV Estimation
fixest = pf.Fixest(data = data)
fixest.feols("Y~X1 | csw0(X2, X3) | X1 ~ Z1", vcov = {'CRV1':'group_id'})
fixest.summary()
# ###
#
# Model:  IV
# Dep. var.:  Y
# Inference:  {'CRV1': 'group_id'}
# Observations:  1998
#
#            Estimate  Std. Error    t value     Pr(>|t|)
# Intercept -3.941293    0.221354 -17.805377 2.442491e-15
#        X1 -0.265817    0.261940  -1.014803 3.203217e-01
# ---
# ###
#
# Model:  IV
# Dep. var.:  Y
# Fixed effects:  X2
# Inference:  {'CRV1': 'group_id'}
# Observations:  1998
#
#     Estimate  Std. Error   t value  Pr(>|t|)
# X1 -0.259964    0.264817 -0.981674  0.336054
# ---
# ###
#
# Model:  IV
# Dep. var.:  Y
# Fixed effects:  X2+X3
# Inference:  {'CRV1': 'group_id'}
# Observations:  1998
#
#     Estimate  Std. Error  t value  Pr(>|t|)
# X1  0.041142    0.201983 0.203688  0.840315
# ---
```




