Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytwoway-pkg, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pytwoway_pkg-0.0.1-py3-none-any.whl (26.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytwoway-pkg-0.0.1.tar.gz (20.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page