Skip to content

Commit 0471ee2

Browse files
authored
Merge pull request #243 from DoubleML/s-add-did-cs-multi-documentation
Add documentation for did multi period with repeated cross sections
2 parents 7b73376 + 4028172 commit 0471ee2

File tree

13 files changed

+1299
-47
lines changed

13 files changed

+1299
-47
lines changed

doc/examples/did/py_panel.ipynb

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"source": [
6565
"### Data Details\n",
6666
"\n",
67-
"*Here, we slightly abuse the definition of the potential outcomes. $Y_{i,t}(1)$ corresponds to the (potential) outcome if unit $i$ would have received treatment at time period $\\mathrm{g}$ (where the group $\\mathrm{g}$ is drawn with probabilities based on $Z$).*\n",
67+
"Here, we slightly abuse the definition of the potential outcomes. $Y_{i,t}(1)$ corresponds to the (potential) outcome if unit $i$ would have received treatment at time period $\\mathrm{g}$ (where the group $\\mathrm{g}$ is drawn with probabilities based on $Z$).\n",
6868
"\n",
6969
"More specifically\n",
7070
"\n",
@@ -873,7 +873,7 @@
873873
"cell_type": "markdown",
874874
"metadata": {},
875875
"source": [
876-
"### All combinations\n",
876+
"### All Combinations\n",
877877
"\n",
878878
"The option `gt_combinations=\"all\"` includes all relevant group time values with $t_\\text{pre} < \\min(\\mathrm{g}, t_\\text{eval})$, including longer parallel trend assumptions.\n",
879879
"This can result in multiple estimates for the same $ATT(\\mathrm{g},t)$, which have slightly different assumptions (length of parallel trends)."
@@ -891,6 +891,29 @@
891891
"dml_obj_all.plot_effects()"
892892
]
893893
},
894+
{
895+
"cell_type": "markdown",
896+
"metadata": {},
897+
"source": [
898+
"### Universal Base Period\n",
899+
"\n",
900+
"The option `gt_combinations=\"universal\"` set $t_\\text{pre} = \\mathrm{g} - \\delta - 1$, corresponding to a universal/constant comparison or base period.\n",
901+
"\n",
902+
"Remark that this implies $t_\\text{pre} > t_\\text{eval}$ for all pre-treatment periods (accounting for anticipation). Therefore these effects do not have the same straightforward interpretation as ATT's."
903+
]
904+
},
905+
{
906+
"cell_type": "code",
907+
"execution_count": null,
908+
"metadata": {},
909+
"outputs": [],
910+
"source": [
911+
"dml_obj_universal = DoubleMLDIDMulti(dml_data, **(default_args| {\"gt_combinations\": \"universal\"}))\n",
912+
"dml_obj_universal.fit()\n",
913+
"dml_obj_universal.bootstrap(n_rep_boot=5000)\n",
914+
"dml_obj_universal.plot_effects()"
915+
]
916+
},
894917
{
895918
"cell_type": "markdown",
896919
"metadata": {},

0 commit comments

Comments
 (0)