|
76 | 76 | "\n", |
77 | 77 | "## Selection Bias\n", |
78 | 78 | "\n", |
79 | | - "- Comparing ATE and APE $$ %\n", |
| 79 | + "- Comparing ATE and average population effect $$ %\n", |
80 | 80 | " \\begin{align*}\n", |
81 | 81 | " ATE = & \\Er[Y_i(1) - Y_i(0)] \\\\\n", |
82 | 82 | " = & \\overbrace{\\Er[Y_i(1) - Y_i(0) | T_i=1]}^{\\text{avg treatment effect on treated}} P(T_i=1) + \\overbrace{\\Er[Y_i(1) - Y_i(0) | T_i=0]}^{\\text{avg treatment effect on untreated}} P(T_i=0) \\\\\n", |
|
109 | 109 | " - $\\epsilon_i(d) \\sim N(0,\\sigma^2)$, independent\n", |
110 | 110 | " - Chooses $\\max_d \\Er[Y_i(d)|S_i(0), S_i(1)] = \\max_d S_i(d)$\n", |
111 | 111 | "\n", |
112 | | - "``` python\n", |
| 112 | + "## Selection Bias Example" |
| 113 | + ], |
| 114 | + "id": "27d91c9d-ce50-4c4e-975d-c2b064446aa8" |
| 115 | + }, |
| 116 | + { |
| 117 | + "cell_type": "code", |
| 118 | + "execution_count": 1, |
| 119 | + "metadata": { |
| 120 | + "output-location": "slide" |
| 121 | + }, |
| 122 | + "outputs": [], |
| 123 | + "source": [ |
113 | 124 | "import numpy as np\n", |
114 | 125 | "np.random.seed(0)\n", |
115 | 126 | "class selectiondata:\n", |
|
144 | 155 | "print(\"|APE|ATE|Selection Bias|\\n\" +\n", |
145 | 156 | " \"|---|---|---|\\n\" +\n", |
146 | 157 | " f\"|{data.APE():.2}|{data.ATE():.2}|{data.selectionbias():.2}|\\n\"\n", |
147 | | - " f\"|σ={s:.2}|\\n\\n\")\n", |
148 | | - "```\n", |
149 | | - "\n", |
150 | | - "| APE | ATE | Selection Bias |\n", |
151 | | - "|-------|------|----------------|\n", |
152 | | - "| 0.27 | 0.53 | -0.26 |\n", |
153 | | - "| σ=0.5 | | |\n", |
154 | | - "\n", |
| 158 | + " f\"|σ={s:.2}|\\n\\n\")" |
| 159 | + ], |
| 160 | + "id": "1168a686" |
| 161 | + }, |
| 162 | + { |
| 163 | + "cell_type": "markdown", |
| 164 | + "metadata": {}, |
| 165 | + "source": [ |
155 | 166 | "# Random Experiments\n", |
156 | 167 | "\n", |
157 | 168 | "## Random Experiment\n", |
|
183 | 194 | "\n", |
184 | 195 | "## Example Pfizer Covid Vaccine RCT" |
185 | 196 | ], |
186 | | - "id": "8cf0bac1-836d-44a0-9df0-7c4bccf9940e" |
| 197 | + "id": "99c95cd9-b1fd-42d4-8141-377621fdb856" |
187 | 198 | }, |
188 | 199 | { |
189 | 200 | "cell_type": "code", |
190 | | - "execution_count": 3, |
191 | | - "metadata": {}, |
| 201 | + "execution_count": 2, |
| 202 | + "metadata": { |
| 203 | + "output-location": "slide" |
| 204 | + }, |
192 | 205 | "outputs": [ |
193 | 206 | { |
194 | 207 | "output_type": "stream", |
|
244 | 257 | "\n", |
245 | 258 | "print(\"\\n- All\\n\\n\" + pfizerall.table() + \"\\n - 65+\\n\\n\" + pfizer65.table())" |
246 | 259 | ], |
247 | | - "id": "09523551" |
| 260 | + "id": "b29841c4" |
248 | 261 | }, |
249 | 262 | { |
250 | 263 | "cell_type": "markdown", |
251 | 264 | "metadata": {}, |
252 | 265 | "source": [ |
253 | 266 | "## Sources and Further Reading\n", |
254 | 267 | "\n", |
255 | | - "- [Chapter\n", |
256 | | - " 2](https://causalml-book.org/assets/chapters/CausalML_chap_2.pdf) of\n", |
257 | | - " Chernozhukov et al. (2024) is the basis for much of these slides,\n", |
| 268 | + "- [Chapter 2](http://chapters.causalml-book.org/CausalML_chap_2.pdf)\n", |
| 269 | + " of Chernozhukov et al. (2024) is the basis for much of these slides,\n", |
258 | 270 | " inlcuding the Pfizer/BioNTech Covid Vaccine RCT example\n", |
259 | 271 | "- [Chapter\n", |
260 | 272 | " 1](https://matheusfacure.github.io/python-causality-handbook/01-Introduction-To-Causality.html)\n", |
261 | 273 | " of Facure (2022)\n", |
| 274 | + "- Heckman and Pinto (2024) for a critique of potential outcomes and\n", |
| 275 | + " argument to use more structured economic models\n", |
262 | 276 | "\n", |
263 | 277 | "## References\n", |
264 | 278 | "\n", |
|
267 | 281 | "<https://causalml-book.org/>.\n", |
268 | 282 | "\n", |
269 | 283 | "Facure, Matheus. 2022. *Causal Inference for the Brave and True*.\n", |
270 | | - "<https://matheusfacure.github.io/python-causality-handbook/landing-page.html>." |
| 284 | + "<https://matheusfacure.github.io/python-causality-handbook/landing-page.html>.\n", |
| 285 | + "\n", |
| 286 | + "Heckman, James, and Rodrigo Pinto. 2024. “Econometric Causality: The\n", |
| 287 | + "Central Role of Thought Experiments.” *Journal of Econometrics* 243 (1):\n", |
| 288 | + "105719. https://doi.org/<https://doi.org/10.1016/j.jeconom.2024.105719>." |
271 | 289 | ], |
272 | | - "id": "d369e916-c521-4e77-8261-95dd7d766074" |
| 290 | + "id": "52171e20-38bd-4c0e-9b8b-6cecc19dcbd0" |
273 | 291 | } |
274 | 292 | ], |
275 | 293 | "nbformat": 4, |
|
0 commit comments