Skip to main content

Estimate two way fixed effect labor models

Project description

pytwoway

https://badge.fury.io/py/pytwoway.svg https://travis-ci.com/tlamadon/pytwoway.svg?branch=master

pytwoway is the Python package associated with the following paper:

How Much Should we Trust Estimates of Firm Effects and Worker Sorting?.” by Stéphane Bonhomme, Kerstin Holzheu, Thibaut Lamadon, Elena Manresa, Magne Mogstad, and Bradley Setzler. No. w27368. National Bureau of Economic Research, 2020.

The package provides implementations for a series of estimators for models with two sided heterogeneity:

  1. two way fixed effect estimator as proposed by Abowd Kramarz and Margolis

  2. homoskedastic bias correction as in Andrews et al

  3. heteroskedastic correction as in KSS (TBD)

  4. a group fixed estimator as in BLM

  5. a group correlated random effect as presented in the main paper

If you want to give it a try, you can start the example notebook here: binder. This starts a fully interactive notebook with a simple example that generates data and runs the estimators.

The code is relatively efficient. Solving large sparse linear models relies on using pyamg. This is the code we used to estimate the different decompositions on the US data.

The package provides a python interface as well as an intuitive command line interface. Installation is handled by pip or conda (TBD). The source of the package is available on github at pytwoway. The online documentation is hosted here.

Quick Start

To install from pip, run:

pip install pytwoway

To run using the command line interface:

pytw --my-config config.txt --fe --cre

Example config.txt:

data = file.csv
filetype = csv
col_dict = "{'fid': 'your_firmid_col', 'wid': 'your_workerid_col', 'year': 'your_year_col', 'comp': 'your_compensation_col'}"

Citation

Please use following citation to cite pytwoway in academic publications:

Bibtex entry:

@techreport{bhlmms2020,
  title={How Much Should We Trust Estimates of Firm Effects and Worker Sorting?},
  author={Bonhomme, St{\'e}phane and Holzheu, Kerstin and Lamadon, Thibaut and Manresa, Elena and Mogstad, Magne and Setzler, Bradley},
  year={2020},
  institution={National Bureau of Economic Research}
}

Project details


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.1.1.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytwoway-0.1.1-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

Details for the file pytwoway-0.1.1.tar.gz.

File metadata

  • Download URL: pytwoway-0.1.1.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for pytwoway-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5a0ed4c321bdcf4b3f218bba83e1838cdb131ffd9bc1194b2960c0f5ab5f8297
MD5 80761917cf8bd4646b4b19b3c9538126
BLAKE2b-256 a3985f8b35b28f5d516eaeb672cc0d6478653f8e36c4e180e2f117b48c72015b

See more details on using hashes here.

File details

Details for the file pytwoway-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pytwoway-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for pytwoway-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b37ae6ef5fa46cefdbc4e64ef0db4869753959e95326c7991082a168f1ec9bf
MD5 e4a52a5852031c2c47f9b8d2d4ab7e2c
BLAKE2b-256 8d6e28749ae6ce2bbb07f20f2c83fd9209f9b709e2a17df2ee2bcd0014398a9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page