did-multiplegt-stat 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. did_multiplegt_stat-0.1.0/.gitignore +38 -0
  2. did_multiplegt_stat-0.1.0/CHANGELOG.md +43 -0
  3. did_multiplegt_stat-0.1.0/CITATION.cff +53 -0
  4. did_multiplegt_stat-0.1.0/LICENSE +674 -0
  5. did_multiplegt_stat-0.1.0/PKG-INFO +180 -0
  6. did_multiplegt_stat-0.1.0/README.md +124 -0
  7. did_multiplegt_stat-0.1.0/docs/api/class.md +48 -0
  8. did_multiplegt_stat-0.1.0/docs/api/functional.md +50 -0
  9. did_multiplegt_stat-0.1.0/docs/api/plotting.md +21 -0
  10. did_multiplegt_stat-0.1.0/docs/changelog.md +1 -0
  11. did_multiplegt_stat-0.1.0/docs/examples.md +150 -0
  12. did_multiplegt_stat-0.1.0/docs/help.md +207 -0
  13. did_multiplegt_stat-0.1.0/docs/index.md +94 -0
  14. did_multiplegt_stat-0.1.0/docs/options.md +261 -0
  15. did_multiplegt_stat-0.1.0/docs/parity.md +147 -0
  16. did_multiplegt_stat-0.1.0/docs/stored_results.md +73 -0
  17. did_multiplegt_stat-0.1.0/docs/syntax.md +121 -0
  18. did_multiplegt_stat-0.1.0/pyproject.toml +138 -0
  19. did_multiplegt_stat-0.1.0/src/did_multiplegt_stat/__init__.py +68 -0
  20. did_multiplegt_stat-0.1.0/src/did_multiplegt_stat/core.py +3943 -0
  21. did_multiplegt_stat-0.1.0/src/did_multiplegt_stat/display.py +281 -0
  22. did_multiplegt_stat-0.1.0/src/did_multiplegt_stat/estimator.py +734 -0
  23. did_multiplegt_stat-0.1.0/src/did_multiplegt_stat/plotting.py +544 -0
  24. did_multiplegt_stat-0.1.0/src/did_multiplegt_stat/py.typed +0 -0
  25. did_multiplegt_stat-0.1.0/tests/conftest.py +46 -0
  26. did_multiplegt_stat-0.1.0/tests/data/cf_folds.csv +2017 -0
  27. did_multiplegt_stat-0.1.0/tests/data/gazoline_did_multiplegt_stat.dta +0 -0
  28. did_multiplegt_stat-0.1.0/tests/data/gentzkowetal_didtextbook.dta +0 -0
  29. did_multiplegt_stat-0.1.0/tests/stata_reference/stata_reference_results.csv +156 -0
  30. did_multiplegt_stat-0.1.0/tests/test_class_api.py +102 -0
  31. did_multiplegt_stat-0.1.0/tests/test_custom_models.py +87 -0
  32. did_multiplegt_stat-0.1.0/tests/test_smoke.py +59 -0
  33. did_multiplegt_stat-0.1.0/tests/test_vignette_parity.py +140 -0
@@ -0,0 +1,38 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .coverage
11
+ .coverage.*
12
+ htmlcov/
13
+ *.egg-info/
14
+ build/
15
+ dist/
16
+ .tox/
17
+ .eggs/
18
+
19
+ # Virtual environments
20
+ .venv/
21
+ venv/
22
+ env/
23
+
24
+ # Jupyter
25
+ .ipynb_checkpoints/
26
+
27
+ # OS / editor
28
+ .DS_Store
29
+ *.swp
30
+ .idea/
31
+ .vscode/
32
+
33
+ # Docs
34
+ site/
35
+
36
+ # Local debug
37
+ *.log
38
+ logfile_*.log
@@ -0,0 +1,43 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-06-16
11
+
12
+ Initial public release.
13
+
14
+ ### Added
15
+ - Functional API `did_multiplegt_stat(...)` mirroring the Stata ado-file syntax.
16
+ - Scikit-learn style class `DIDMultiplegtStat` with `.fit() / .summary() / .plot() /
17
+ .to_dataframe() / .get_coefficients() / .get_confidence_intervals() /
18
+ .get_params() / .set_params()`.
19
+ - AS (Average Slope), WAS (Weighted Average Slope), and IV-WAS estimators.
20
+ - Estimation methods: regression adjustment (`ra`), propensity score (`ps`),
21
+ doubly robust (`dr`).
22
+ - Stata-faithful backend (`asinstata=True`) with from-scratch Newton-Raphson
23
+ logit matching Stata's `logit, asis` defaults, plus a float32 sweep
24
+ implementation of `_svd_wls` reproducing Stata's `reg` collinearity handling.
25
+ - Scikit-learn default backend (`asinstata=False`) for faster modern numerics.
26
+ - Pluggable custom nuisance models (`model_deltay=`, `model_stayer=`) accepting
27
+ any sklearn-style `fit`/`predict`/`predict_proba` object.
28
+ - Three IV regression backends: manual 2SLS (default), `linearmodels`, `econtools`.
29
+ - Multi-period placebos via `placebo=N` (N > 0).
30
+ - Bootstrap standard errors and TWFE comparison with `same_sample`/`full_sample`
31
+ and percentile / normal CIs.
32
+ - Cross-fitting (`cross_fitting=K`) with Stata-compatible MT19937-64 RNG, and
33
+ external CSV fold-import via `cf_folds_file=` for exact ado-file parity.
34
+ - Cluster-robust standard errors via `cluster=`.
35
+ - By-group analysis: `by=[...]`, `by_fd=K`, `by_baseline=K`.
36
+ - K-fold cross-validation for polynomial order selection via
37
+ `cross_validation={...}`.
38
+ - Trimming, no-extrapolation, exact matching, multiple control variables,
39
+ other-treatments adjustment, on-placebo-sample option.
40
+
41
+ ### Documentation
42
+ - mkdocs-material site with Stata help-file style reference, Python API
43
+ reference, options matrix, examples, and Stata-to-Python parity guide.
@@ -0,0 +1,53 @@
1
+ cff-version: 1.2.0
2
+ title: "did_multiplegt_stat (Python port)"
3
+ message: "If you use this software in academic work, please cite the underlying paper."
4
+ type: software
5
+ license: GPL-3.0-or-later
6
+ version: "0.1.0"
7
+ date-released: "2026-06-16"
8
+ url: "https://github.com/chaisemartin/did_multiplegt_stat"
9
+ repository-code: "https://github.com/chaisemartin/did_multiplegt_stat"
10
+ authors:
11
+ - family-names: "de Chaisemartin"
12
+ given-names: "Clément"
13
+ affiliation: "Sciences Po, Economics Department"
14
+ - family-names: "Ciccia"
15
+ given-names: "Diego"
16
+ affiliation: "Sciences Po"
17
+ - family-names: "D'Haultfœuille"
18
+ given-names: "Xavier"
19
+ affiliation: "CREST-ENSAE"
20
+ - family-names: "Knau"
21
+ given-names: "Felix"
22
+ affiliation: "Sciences Po"
23
+ - family-names: "Pasquier"
24
+ given-names: "Felix"
25
+ affiliation: "CREST-ENSAE"
26
+ - family-names: "Sow"
27
+ given-names: "Doulo"
28
+ affiliation: "Sciences Po"
29
+ - family-names: "Vazquez-Bare"
30
+ given-names: "Gonzalo"
31
+ affiliation: "UCSB"
32
+ - family-names: "Quispe"
33
+ given-names: "Anzony"
34
+ email: "anzony.quispe@gmail.com"
35
+ preferred-citation:
36
+ type: article
37
+ title: "Difference-in-Differences Estimators for Treatments Continuously Distributed at Every Period"
38
+ year: 2024
39
+ identifiers:
40
+ - type: other
41
+ value: "arXiv:2201.06898"
42
+ description: "arXiv preprint"
43
+ authors:
44
+ - family-names: "de Chaisemartin"
45
+ given-names: "Clément"
46
+ - family-names: "D'Haultfœuille"
47
+ given-names: "Xavier"
48
+ - family-names: "Pasquier"
49
+ given-names: "Felix"
50
+ - family-names: "Sow"
51
+ given-names: "Doulo"
52
+ - family-names: "Vazquez-Bare"
53
+ given-names: "Gonzalo"