Code to perform econometric test of firm conduct
Project description
This code was written to perform the procedure for testing firm conduct developed in “Testing Firm Conduct” by Marco Duarte, Lorenzo Magnolfi, Mikkel Sølvsten, and Christopher Sullivan. It builds on the PyBLP source code (see Conlon and Gortmaker (2020)) - to do so.
The code implements the following features:
Computes Rivers and Vuong (2002) (RV) test statistics to test a menu of two or more models of firm conduct allowing for the possibility that firms or consumers face per unit or ad-valorem taxes.
Implements the RV test using the variance estimator of Duarte, Magnolfi, Sølvsten, and Sullivan (2023), including options to adjust for demand estimation error and clustering
Computes the effective F-statistic proposed in Duarte, Magnolfi, Sølvsten, and Sullivan (2023) to diagnose instrument strength with respect to worst-case size and best-case power of the test, and reports appropriate critical values
Reports Hansen, Lunde, and Nason (2011) MCS p-values for testing more than two models
Compatible with PyBLP Conlon and Gortmaker (2020), so that demand can be estimated with PyBLP, and the estimates are an input to the test for conduct
For a full list of references, see the references in Duarte, Magnolfi, Sølvsten, and Sullivan (2023).
Install
First, you will need to download and install python, which you can do from this link.
You will also need to make sure that you have all package dependencies installed.
To install the pyRVtest package, use pip:
pip install pyRVtest
This should automatically install the python packages on which pyRVtest depends: numpy, pandas, statsmodels, pyblp
To update to a newer version of the package use:
pip install --upgrade pyRVtest
Using the package
For a detailed tutorial about how to set up and run the testing procedure, see Tutorial.
Citing the package
When using the package, please include the following citation:
Duarte, M., L. Magnolfi, M. Sølvsten, C. Sullivan, and A. Tarascina (2023): “pyRVtest: A Python package for testing firm conduct,” https://github.com/anyatarascina/pyRVtest.
@misc{ pyrvtest, author={Marco Duarte and Lorenzo Magnolfi and Mikkel S{o}lvsten and Christopher Sullivan and Anya Tarascina}, title={texttt{pyRVtest}: A Python package for testing firm conduct}, howpublished={url{https://github.com/anyatarascina/pyRVtest}}, year={2023}
Bugs and Requests
Please use the GitHub issue tracker to submit bugs or to request features.
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
Built Distribution
File details
Details for the file pyRVtest-0.3.1.tar.gz
.
File metadata
- Download URL: pyRVtest-0.3.1.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e8f2ac9d4fc877dedae062643bfd25b650289495617a4caf0b2ee5a51737667 |
|
MD5 | bceded36abf52342f9a0758c61d908e7 |
|
BLAKE2b-256 | 9068a4f92c721af7bd55b4e7c89b83539f42e57577f8b152a6a3200d5f83e041 |
File details
Details for the file pyRVtest-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: pyRVtest-0.3.1-py3-none-any.whl
- Upload date:
- Size: 66.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 526e87af16b3bd91cb9035ec8af64bc05d57031528de2c6b12a12a68213f5626 |
|
MD5 | fb59303c30707957db09907bdaaded0a |
|
BLAKE2b-256 | c745091b7b650931a674bb1f93c2411ffdd3e9fadf16046641de4c4dee1f8f8d |