Estimate two way fixed effect labor models
Project description
pytwoway
Two way fixed effect models for labor in python
Full documentation can be found here.
Quick start:
To install from pip:
pip install pytwoway
To run using command line interface:
pytw --my-config config.txt --akm --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'}"
To run in Python:
- If you have data
from pytwoway import twfe_network as tn
# Create twfe object
tw_net = tn.TwoWay(data, formatting, col_dict)
# Prepare data for FE estimator
tw_net.prep_fe()
# Fit FE estimator
tw_net.fit_fe(user_fe)
# Prepare data for CRE estimator
tw_net.prep_cre(user_cluster)
# Run the CRE estimator
tw_net.run_cre(user_cre)
- If you want to simulate data
from pytwoway import sim_twfe_network as sn
# Create simulated twfe object
stw_net = sn.SimTwoWay(sim_params)
# Generate data
sim_data = stw_net.sim_network()
- If you want to run Monte Carlo on simulated data
from pytwoway import sim_twfe_network as sn
# Create simulated Monte Carlo object
smc_net = sn.TwoWayMonteCarlo(sim_params)
# Run Monte Carlo
smc_net.twfe_monte_carlo(N, ncore, akm_params, cre_params, cluster_params)
# Plot results
smc_net.plot_monte_carlo()
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.4.tar.gz
(31.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pytwoway-0.0.4-py3-none-any.whl
(46.8 kB
view details)
File details
Details for the file pytwoway-0.0.4.tar.gz.
File metadata
- Download URL: pytwoway-0.0.4.tar.gz
- Upload date:
- Size: 31.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef7982fe934849edd4d29d160aee4ad16f239c4b978ca89d6eaaf5083a4274a2
|
|
| MD5 |
dd79f82e6c7ac81e01d36ba717467632
|
|
| BLAKE2b-256 |
628a4a29337d02af5b7401c9dbc06bc8e4b1bd90bd59c84b6f246b66f34a3e4b
|
File details
Details for the file pytwoway-0.0.4-py3-none-any.whl.
File metadata
- Download URL: pytwoway-0.0.4-py3-none-any.whl
- Upload date:
- Size: 46.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0419cddc36eb18e1e841508ffb137866082b25a3ded6b1818a6fd1ffb0066cb9
|
|
| MD5 |
f814b92b43061bbecf59080f4dda2923
|
|
| BLAKE2b-256 |
a52ad58f9c6d1d4254da0ac6078017415af0595b2b81a21009ace8740efa0cc8
|