CausalTensor
CausalTensor is a python package for doing causal inference and policy evaluation using panel data. The package achieves 13K downloads by 2025-03.
What is CausalTensor
CausalTensor is a suite of tools for addressing questions like "What is the impact of strategy X to outcome Y" given time-series data colleting from multiple units. Answering such questions has wide range of applications from econometrics, operations research, business analytics, polictical science, to healthcare. Please visit our complete documentation for more information.
Installing CausalTensor
CausalTensor is compatible with Python 3 or later and also depends on numpy. The simplest way to install CausalTensor and its dependencies is from PyPI with pip, Python's preferred package installer.
$ pip install causaltensor
Note that CausalTensor is an active project and routinely publishes new releases. In order to upgrade CausalTensor to the latest version, use pip as follows.
$ pip install -U causaltensor
Using CausalTensor
We have implemented the following estimators including the traditional method Difference-in-Difference and recent proposed methods such as Synthetic Difference-in-Difference, Matrix Completion with Nuclear Norm Minimization, and De-biased Convex Panel Regression.
| Estimator | Reference |
|---|---|
| Difference-in-Difference (DID) | Implemented through two-way fixed effects regression. |
| De-biased Convex Panel Regression (DC-PR) | Vivek Farias, Andrew Li, and Tianyi Peng. "Learning treatment effects in panels with general intervention patterns." Advances in Neural Information Processing Systems 34 (2021): 14001-14013. |
| Synthetic Control (OLS SC) | Abadie, Alberto, and Javier Gardeazabal. “The Economic Costs of Conflict: A Case Study of the Basque Country.” The American Economic Review 93, no. 1 (2003): 113–32. |
| Synthetic Difference-in-Difference (SDID) | Dmitry Arkhangelsky, Susan Athey, David A. Hirshberg, Guido W. Imbens, and Stefan Wager. "Synthetic difference-in-differences." American Economic Review 111, no. 12 (2021): 4088-4118. |
| Matrix Completion with Nuclear Norm Minimization (MC-NNM) | Susan Athey, Mohsen Bayati, Nikolay Doudchenko, Guido Imbens, and Khashayar Khosravi. "Matrix completion methods for causal panel data models." Journal of the American Statistical Association 116, no. 536 (2021): 1716-1730. |
Please visit our documentation for the usage instructions. Or check the following simple demo as a tutorial:
Metadata
Release files for causaltensor 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| causaltensor-0.1.12.tar.gz | 31.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| causaltensor-0.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.9 kB
Release files / causaltensor-0.1.12.tar.gz
| Download URL | causaltensor-0.1.12.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3493708a16e547fa0f9fa776903b20181f2dfc359285e5089d1d1fdb1a6588ce
|
|
BLAKE2b-256 checksum How to use checksums |
ecd9531047a8f2cdbf3fa87f16b5f2c5221006dc1117b9da22b590ca6ed9c98d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.7
|
Release files / causaltensor-0.1.12-py3-none-any.whl
| Download URL | causaltensor-0.1.12-py3-none-any.whl |
|---|---|
| Size | 41.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48edc7620988fa870afb80610cd2cab7771c3be2a5e6b1299a546fbb189d5b47
|
|
BLAKE2b-256 checksum How to use checksums |
1953178b36b775141dce511d6c972037c10dd1c36f08dd81da4b3bbf15b2b5d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.7
|
Security for causaltensor 0.1.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.