Skip to content

Commit d58a1c6

Browse files
committed
fix notebook and typo in did model
1 parent f19ddf3 commit d58a1c6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/examples/py_double_ml_did.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
"outputs": [],
165165
"source": [
166166
"n_rep = 200\n",
167-
"ATTE = 0\n",
167+
"ATTE = 0.0\n",
168168
"\n",
169169
"ATTE_estimates = np.full((n_rep), np.nan)\n",
170170
"coverage = np.full((n_rep), np.nan)\n",
@@ -181,7 +181,7 @@
181181
"\n",
182182
" ATTE_estimates[i_rep] = dml_did.coef\n",
183183
" confint = dml_did.confint(level=0.95)\n",
184-
" coverage [i_rep] = (confint['2.5 %'] < ATTE) & (ATTE < confint['97.5 %'])\n",
184+
" coverage [i_rep] = (confint['2.5 %'] <= ATTE) & (ATTE <= confint['97.5 %'])\n",
185185
" ci_length[i_rep] = confint['97.5 %'] - confint['2.5 %']"
186186
]
187187
},
@@ -367,7 +367,7 @@
367367
"outputs": [],
368368
"source": [
369369
"n_rep = 200\n",
370-
"ATTE = 0\n",
370+
"ATTE = 0.0\n",
371371
"\n",
372372
"ATTE_estimates = np.full((n_rep), np.nan)\n",
373373
"coverage = np.full((n_rep), np.nan)\n",
@@ -384,7 +384,7 @@
384384
"\n",
385385
" ATTE_estimates[i_rep] = dml_did.coef\n",
386386
" confint = dml_did.confint(level=0.95)\n",
387-
" coverage [i_rep] = (confint['2.5 %'] < ATTE) & (ATTE < confint['97.5 %'])\n",
387+
" coverage [i_rep] = (confint['2.5 %'] <= ATTE) & (ATTE <= confint['97.5 %'])\n",
388388
" ci_length[i_rep] = confint['97.5 %'] - confint['2.5 %']"
389389
]
390390
},
@@ -450,7 +450,7 @@
450450
"name": "python",
451451
"nbconvert_exporter": "python",
452452
"pygments_lexer": "ipython3",
453-
"version": "3.11.2"
453+
"version": "3.10.10"
454454
},
455455
"orig_nbformat": 4,
456456
"vscode": {

doc/shared/models/did.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let :math:`Y_{it}` be the outcome of interest for unit :math:`i` at time :math:`
66
if unit :math:`i` is treated before time :math:`t` (otherwise :math:`D_{it}=0`). Since all units start as untreated (:math:`D_{i0}=0`), define
77
:math:`D_{i}=D_{i1}.` Relying on the potential outcome notation, denote :math:`Y_{it}(0)` as the outcome of unit :math:`i` at time :math:`t` if the unit did not receive
88
treatment up until time :math:`t` and analogously for :math:`Y_{it}(1)` with treatment. Consequently, the observed outcome
9-
for unit is :math:`i` at time :math:`t` is :math:`Y_{it}=D_i Y_{it}(1) + (1-D_i) Y_{it}(0)`. Further, let
9+
for unit is :math:`i` at time :math:`t` is :math:`Y_{it}=D_{it} Y_{it}(1) + (1-D_{it}) Y_{it}(0)`. Further, let
1010
:math:`X_i` be a vector of pre-treatment covariates.
1111

1212
Target parameter of interest is the average treatment effect on the treated (ATTE)

0 commit comments

Comments
 (0)