{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Chapter 27: Potential Outcomes and Randomized Experiments\n",
        "**Economic question:** What does a causal effect mean for one unit, and why can we never observe both potential outcomes?\n",
        "\nA causal effect compares two potential outcomes for the same unit, but only one is observed.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import numpy as np\n",
        "rng=np.random.default_rng(27); n=2000; treatment=rng.binomial(1,.5,n); y0=rng.normal(50,10,n); y=y0+5*treatment+rng.normal(0,3,n)\n",
        "ate=y[treatment==1].mean()-y[treatment==0].mean()\n",
        "print('difference in means',ate)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Interpretation checklist\n",
        "- State the unit of observation and units of every variable.\n",
        "- Separate association, prediction, and causation.\n",
        "- Report magnitude and uncertainty.\n",
        "- Identify the most important threat to validity.\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.13"
    },
    "ceteris_lab": {
      "course_slug": "fundamentals-python-econometrics",
      "course_title": "Fundamentals of Python for Financial Econometrics",
      "chapter": 27,
      "source_origin": "supplied"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
