Commit ececea3
feat(rdd): covariate-adjusted RD - covariates= on fit() with rdrobust 4.0.0 parity (CCFT 2019)
Adds the CCFT 2019 additive common-coefficient covariate adjustment to
RegressionDiscontinuity (sharp AND fuzzy), parity-targeting R rdrobust
4.0.0 end-to-end. The estimand is unchanged (precision only, unlike the
DiD estimators' conditional-parallel-trends covariates role); bandwidths
are covariate-aware (Z threads into every pilot of all three selector
chains with a per-pilot partialled gamma); collinear covariates are
dropped with a warning naming them under covs_drop=True (R's exact
dqrdc2 rank/pivot semantics incl. the name-length column sort, ported
directly; covs_drop=False is a deterministic strict error).
Degenerate covariate adjustment is GUARDED, not reproduced (documented
Deviation from R): R's ginv(tol=1e-20) inverts a float-noise singular
value on constant covariates / full dummy sets, silently returning
platform-dependent estimates; diff-diff excludes per-column degeneracies
(a constant covariate reproduces the fit without it bit-for-bit),
applies a scale-invariant stabilized cut for rank-deficient sets (a full
dummy set reproduces the drop-one-category fit - span invariance), and
warns naming the columns. Well-posed systems match R at machine
precision.
Surfaces: covariates= (fit-time, library-wide name), covs_drop=
constructor knob, name-keyed covariate_coefficients /
first_stage_covariate_coefficients + covariates/covariates_dropped/
covs_drop result echoes, covariate-adjusted summary() banner. Goldens
23 -> 32 configs (9 covariate configs incl. msetwo/cercomb2 chain pins,
collinear-drop, ties, fuzzy, fuzzy-sharpbw; all 23 pre-existing configs
reproduced exactly on regeneration; worst covariate-config disagreement
6.2e-12). R-free anchors: the CCFT 2019 partial-out identity
tau_adj = tau_unadj - gamma' tau_Z exact at common manual bandwidths
(both conventional and bias-corrected rows), span/order invariance,
CI shrinkage. Docs: REGISTRY covariate subsection + deviation notes,
CCFT-2019/2017 review checkbox flips, api rst, llms guides, README,
CHANGELOG, references, choosing-estimator.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QGca52n6H8oDDXALjjrsp41 parent 51ce969 commit ececea3
20 files changed
Lines changed: 2308 additions & 194 deletions
File tree
- benchmarks
- R
- data
- diff_diff
- guides
- docs
- api
- methodology
- papers
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
32 | 50 | | |
33 | 51 | | |
34 | 52 | | |
| |||
37 | 55 | | |
38 | 56 | | |
39 | 57 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
47 | 69 | | |
48 | 70 | | |
49 | 71 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
54 | 78 | | |
55 | 79 | | |
56 | 80 | | |
| |||
134 | 158 | | |
135 | 159 | | |
136 | 160 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
140 | 164 | | |
141 | 165 | | |
142 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | | - | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
69 | 83 | | |
70 | 84 | | |
71 | 85 | | |
| |||
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
78 | | - | |
| 92 | + | |
| 93 | + | |
79 | 94 | | |
80 | 95 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
86 | 101 | | |
87 | 102 | | |
88 | 103 | | |
| |||
162 | 177 | | |
163 | 178 | | |
164 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
165 | 216 | | |
166 | 217 | | |
167 | 218 | | |
| |||
0 commit comments