Two way fixed effect models in python
Project description
pytwoway
Two way fixed effect models in python
To run using default options:
- If you have data
from pytwoway import twfe_network as tn
# data is labor data, formatting is 'long' or 'event study', and col_dict gives a dictionary of column names:
d_net = tn.twfe_network(data, formatting, col_dict)
# Convert long data into event study data (not necessary if the data is already in event study format):
d_net.refactor_es()
# Run the bias-corrected AKM estimator:
d_net.run_akm_corrected()
# Cluster firms based on their wage CDFs (required for the CRE estimator)
d_net.cluster()
# Run the CRE estimator
d_net.run_cre()
- If you want to simulate data
from pytwoway import twfe_network as tn
# Parameters are optional when simulating data:
d_net = tn.twfe_network()
# Convert long data into event study data (this is necessary for simulated data):
d_net.refactor_es()
# Run the bias-corrected AKM estimator:
d_net.run_akm_corrected()
# Cluster firms based on their wage CDFs (required for the CRE estimator)
d_net.cluster()
# Run the CRE estimator
d_net.run_cre()
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
pytwoway-0.0.1.tar.gz
(20.8 kB
view hashes)
Built Distribution
pytwoway-0.0.1-py3-none-any.whl
(26.7 kB
view hashes)