|
10 | 10 | },
|
11 | 11 | {
|
12 | 12 | "cell_type": "markdown",
|
| 13 | + "id": "6c070d4e", |
13 | 14 | "metadata": {},
|
14 | 15 | "source": [
|
15 | 16 | "In this example we will show how to use the DoubleML package to obtain confidence sets for the treatment effects that are robust to weak instruments. Weak instruments are those that have a relatively weak correlation with the treatment. It is well known that in this case, standard methods to construct confidence intervals have poor properties and can have coverage much lower than the nominal value. We will assume that the reader of this notebook is already familiar with DoubleML and how it can be used to fit instrumental variable models.\n",
|
|
29 | 30 | },
|
30 | 31 | {
|
31 | 32 | "cell_type": "code",
|
32 |
| - "execution_count": 1, |
| 33 | + "execution_count": null, |
| 34 | + "id": "f9e7a46f", |
33 | 35 | "metadata": {},
|
34 | 36 | "outputs": [],
|
35 | 37 | "source": [
|
|
46 | 48 | },
|
47 | 49 | {
|
48 | 50 | "cell_type": "markdown",
|
| 51 | + "id": "b6b976ce", |
49 | 52 | "metadata": {},
|
50 | 53 | "source": [
|
51 | 54 | "# Running a small simulation"
|
|
61 | 64 | },
|
62 | 65 | {
|
63 | 66 | "cell_type": "code",
|
64 |
| - "execution_count": 2, |
| 67 | + "execution_count": null, |
65 | 68 | "id": "82111204",
|
66 | 69 | "metadata": {},
|
67 | 70 | "outputs": [],
|
|
86 | 89 | },
|
87 | 90 | {
|
88 | 91 | "cell_type": "code",
|
89 |
| - "execution_count": 3, |
| 92 | + "execution_count": null, |
90 | 93 | "id": "9a347c25",
|
91 | 94 | "metadata": {},
|
92 | 95 | "outputs": [],
|
|
117 | 120 | },
|
118 | 121 | {
|
119 | 122 | "cell_type": "code",
|
120 |
| - "execution_count": 4, |
| 123 | + "execution_count": null, |
121 | 124 | "id": "600b8196",
|
122 | 125 | "metadata": {},
|
123 | 126 | "outputs": [],
|
|
163 | 166 | },
|
164 | 167 | {
|
165 | 168 | "cell_type": "code",
|
166 |
| - "execution_count": 5, |
| 169 | + "execution_count": null, |
167 | 170 | "id": "86c83edc",
|
168 | 171 | "metadata": {},
|
169 |
| - "outputs": [ |
170 |
| - { |
171 |
| - "name": "stdout", |
172 |
| - "output_type": "stream", |
173 |
| - "text": [ |
174 |
| - " DML coverage Robust coverage DML median length \\\n", |
175 |
| - "instrument_strength \n", |
176 |
| - "0.003 0.15 0.91 0.489567 \n", |
177 |
| - "1.000 0.93 0.92 0.572717 \n", |
178 |
| - "\n", |
179 |
| - " Robust median length \n", |
180 |
| - "instrument_strength \n", |
181 |
| - "0.003 inf \n", |
182 |
| - "1.000 0.582754 \n" |
183 |
| - ] |
184 |
| - } |
185 |
| - ], |
| 172 | + "outputs": [], |
186 | 173 | "source": [
|
187 | 174 | "results_df = pd.DataFrame(output_list)\n",
|
188 | 175 | "summary_df = results_df.groupby(\"instrument_strength\").agg(\n",
|
|
211 | 198 | "- Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., and Hansen, C. (2018). Double/debiased machine learning for\n",
|
212 | 199 | "treatment and structural parameters. The Econometrics Journal, 21(1):C1–C68.\n",
|
213 | 200 | "- Ma, Y. (2023). Identification-robust inference for the late with high-dimensional covariates. arXiv preprint arXiv:2302.09756.\n",
|
| 201 | + "- Smucler, E., Lanni, L., Masip, D. (2025). A note on the properties of the confidence set for the local average treatment effect obtained by inverting the score test. arXiv preprint 2506.10449\n", |
214 | 202 | "- Stock, J. H. and Wright, J. H. (2000). GMM with weak identification. Econometrica, 68(5):1055–1096.\n",
|
215 | 203 | "- Takatsu, K., Levis, A. W., Kennedy, E., Kelz, R., and Keele, L. (2023). Doubly robust machine learning for an instrumental\n",
|
216 | 204 | "variable study of surgical care for cholecystitis. arXiv preprint arXiv:2307.06269."
|
|
233 | 221 | "name": "python",
|
234 | 222 | "nbconvert_exporter": "python",
|
235 | 223 | "pygments_lexer": "ipython3",
|
236 |
| - "version": "3.12.3" |
| 224 | + "version": "3.13.1" |
237 | 225 | }
|
238 | 226 | },
|
239 | 227 | "nbformat": 4,
|
|
0 commit comments