diff-diff 0.3.0__py3-none-any.whl → 0.5.0__py3-none-any.whl
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.
- diff_diff/__init__.py +62 -3
- diff_diff/diagnostics.py +885 -0
- diff_diff/estimators.py +146 -34
- diff_diff/prep.py +532 -38
- diff_diff/results.py +26 -7
- diff_diff/staggered.py +982 -0
- diff_diff/utils.py +379 -3
- diff_diff/visualization.py +471 -0
- {diff_diff-0.3.0.dist-info → diff_diff-0.5.0.dist-info}/METADATA +417 -10
- diff_diff-0.5.0.dist-info/RECORD +12 -0
- diff_diff-0.3.0.dist-info/RECORD +0 -9
- {diff_diff-0.3.0.dist-info → diff_diff-0.5.0.dist-info}/WHEEL +0 -0
- {diff_diff-0.3.0.dist-info → diff_diff-0.5.0.dist-info}/top_level.txt +0 -0
diff_diff/__init__.py
CHANGED
|
@@ -5,8 +5,27 @@ This library provides sklearn-like estimators for causal inference
|
|
|
5
5
|
using the difference-in-differences methodology.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from diff_diff.estimators import
|
|
9
|
-
|
|
8
|
+
from diff_diff.estimators import (
|
|
9
|
+
DifferenceInDifferences,
|
|
10
|
+
TwoWayFixedEffects,
|
|
11
|
+
MultiPeriodDiD,
|
|
12
|
+
SyntheticDiD,
|
|
13
|
+
)
|
|
14
|
+
from diff_diff.staggered import (
|
|
15
|
+
CallawaySantAnna,
|
|
16
|
+
CallawaySantAnnaResults,
|
|
17
|
+
GroupTimeEffect,
|
|
18
|
+
)
|
|
19
|
+
from diff_diff.results import (
|
|
20
|
+
DiDResults,
|
|
21
|
+
MultiPeriodDiDResults,
|
|
22
|
+
PeriodEffect,
|
|
23
|
+
SyntheticDiDResults,
|
|
24
|
+
)
|
|
25
|
+
from diff_diff.visualization import (
|
|
26
|
+
plot_event_study,
|
|
27
|
+
plot_group_effects,
|
|
28
|
+
)
|
|
10
29
|
from diff_diff.prep import (
|
|
11
30
|
make_treatment_indicator,
|
|
12
31
|
make_post_indicator,
|
|
@@ -17,19 +36,58 @@ from diff_diff.prep import (
|
|
|
17
36
|
generate_did_data,
|
|
18
37
|
create_event_time,
|
|
19
38
|
aggregate_to_cohorts,
|
|
39
|
+
rank_control_units,
|
|
40
|
+
)
|
|
41
|
+
from diff_diff.utils import (
|
|
42
|
+
check_parallel_trends,
|
|
43
|
+
check_parallel_trends_robust,
|
|
44
|
+
equivalence_test_trends,
|
|
45
|
+
WildBootstrapResults,
|
|
46
|
+
wild_bootstrap_se,
|
|
47
|
+
)
|
|
48
|
+
from diff_diff.diagnostics import (
|
|
49
|
+
PlaceboTestResults,
|
|
50
|
+
run_placebo_test,
|
|
51
|
+
placebo_timing_test,
|
|
52
|
+
placebo_group_test,
|
|
53
|
+
permutation_test,
|
|
54
|
+
leave_one_out_test,
|
|
55
|
+
run_all_placebo_tests,
|
|
20
56
|
)
|
|
21
57
|
|
|
22
|
-
__version__ = "0.
|
|
58
|
+
__version__ = "0.5.0"
|
|
23
59
|
__all__ = [
|
|
24
60
|
# Estimators
|
|
25
61
|
"DifferenceInDifferences",
|
|
62
|
+
"TwoWayFixedEffects",
|
|
26
63
|
"MultiPeriodDiD",
|
|
27
64
|
"SyntheticDiD",
|
|
65
|
+
"CallawaySantAnna",
|
|
28
66
|
# Results
|
|
29
67
|
"DiDResults",
|
|
30
68
|
"MultiPeriodDiDResults",
|
|
31
69
|
"SyntheticDiDResults",
|
|
32
70
|
"PeriodEffect",
|
|
71
|
+
"CallawaySantAnnaResults",
|
|
72
|
+
"GroupTimeEffect",
|
|
73
|
+
# Visualization
|
|
74
|
+
"plot_event_study",
|
|
75
|
+
"plot_group_effects",
|
|
76
|
+
# Parallel trends testing
|
|
77
|
+
"check_parallel_trends",
|
|
78
|
+
"check_parallel_trends_robust",
|
|
79
|
+
"equivalence_test_trends",
|
|
80
|
+
# Wild cluster bootstrap
|
|
81
|
+
"WildBootstrapResults",
|
|
82
|
+
"wild_bootstrap_se",
|
|
83
|
+
# Placebo tests / diagnostics
|
|
84
|
+
"PlaceboTestResults",
|
|
85
|
+
"run_placebo_test",
|
|
86
|
+
"placebo_timing_test",
|
|
87
|
+
"placebo_group_test",
|
|
88
|
+
"permutation_test",
|
|
89
|
+
"leave_one_out_test",
|
|
90
|
+
"run_all_placebo_tests",
|
|
33
91
|
# Data preparation utilities
|
|
34
92
|
"make_treatment_indicator",
|
|
35
93
|
"make_post_indicator",
|
|
@@ -40,4 +98,5 @@ __all__ = [
|
|
|
40
98
|
"generate_did_data",
|
|
41
99
|
"create_event_time",
|
|
42
100
|
"aggregate_to_cohorts",
|
|
101
|
+
"rank_control_units",
|
|
43
102
|
]
|