From abd62e060a311e7106000aef6939a18c1dc42e4c Mon Sep 17 00:00:00 2001 From: AliFozooni Date: Sat, 15 Aug 2026 10:59:07 -0700 Subject: [PATCH] Correct the propensity-score identification proof --- .../11-Propensity-Score.ipynb | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/causal-inference-for-the-brave-and-true/11-Propensity-Score.ipynb b/causal-inference-for-the-brave-and-true/11-Propensity-Score.ipynb index 2d47e9a..ff4b3b9 100644 --- a/causal-inference-for-the-brave-and-true/11-Propensity-Score.ipynb +++ b/causal-inference-for-the-brave-and-true/11-Propensity-Score.ipynb @@ -282,9 +282,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Simply comparing those with and without the intervention, we can see that the treated have an achievement score that is, on average, 0.3185 (0.4723 - 0.1538) higher than the average score (which is zero, since the score is standardized). But is this big or small? I know that interpreting standardized outcomes can be challenging, but bear with me for a moment. I think it is worth going through this because it won't be the last time you will encounter standardized scores.\n", + "The intercept tells us that the untreated mean is -0.1538. The coefficient on the intervention, 0.4723, is the treated-minus-untreated difference, so the treated mean is $-0.1538 + 0.4723 = 0.3185$. Standardization makes the pooled outcome mean zero; it does not make the untreated mean zero.\n", " \n", - "The outcome variable being standardized means that it is measured in standard deviations. So, the treated are 0.3185 deviations above the untreated. That is what this means. As for if this is small or big, let's remember some stuff about the normal distribution. We know that 95% of its mass is between 2 standard deviations, leaving 2.5% on one tail and 2.5% on another. This also means that if someone is 2 standard deviations above the mean, 97.5% (95% plus the left 2.5% tail) of all the individuals are below that person. By looking at the normal CDF, we also know that about 85% of its mass is below 1 standard deviation and that 70% of its mass is below 0.5 standard deviations. Since the treated group has an average standardized score of about 0.5, this means that they fall above 70% in terms of individual achievement. Or, in other words, they are in the top 30% who achieve more. Here is what this looks like in a picture." + "The observed groups therefore differ by 0.4723 standard deviations. For orientation, under a standard-normal reference, a score of 0.3185 is around the 62.5th percentile. This comparison is descriptive, not yet causal: participation in the intervention was not randomized. Here is what the two group means look like in the outcome distribution." ] }, { @@ -433,41 +433,50 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "If I know what e(x) is, X alone tells me nothing more that can help me learn what T would be. Which means that controlling for e(x) acts the same way as controlling for X directly. Think of it in terms of our mindset program. Treated and non treated are initially not comparable because the more ambitious are both more likely to take the treatment and of achieving more in life. However, if I take 2 individuals, one from the treated and one from the control, but with the same probability of receiving the treatment, they are comparable. Think about it. If they have the exact same probability of receiving the treatment, the only reason one of them received it and the other did not is pure chance. Holding the propensity score constant acts in a way of making the data look as good as random. \n", + "The propensity score has a precise **balancing property**: once we condition on $e(X)$, the covariates $X$ contain no additional information about treatment. In notation, $T \\perp X \\mid e(X)$. This is not the same as saying that the potential outcomes are independent of treatment. To replace adjustment for the full covariate vector with adjustment for the propensity score, we also need conditional exchangeability, $(Y_0,Y_1) \\perp T \\mid X$.\n", "\n", - "Now that we got the intuition, let's look at the mathematical proof. We want to show that $(Y_1, Y_0) \\perp T | e(x)$ is equivalent to saying that \n", + "In the mindset example, the observed treated and untreated groups are initially not comparable. Under conditional exchangeability, however, treated and untreated units with the same propensity score have balanced covariate distributions, and treatment is independent of the potential outcomes within propensity-score strata. The propensity score reduces the dimension of the adjustment problem; it cannot repair unmeasured confounding.\n", "\n", - "$\n", - "E[T|e(x), X] = E[T|e(x)] \n", - "$\n", + "For a binary treatment, first consider the balancing property. Because $e(X)=P(T=1\\mid X)$ is a function of $X$,\n", "\n", - "This simply says that once I condition on $e(x)$, X can give me no extra information about $T$. The proof of this is quite weird. We will show that the equation above is true by converting it to a trivial statement. First take a look at the left hand side $E[T|e(x), X]$.\n", + "$$\n", + "P(T=1\\mid X,e(X))=P(T=1\\mid X)=e(X),\n", + "$$\n", "\n", - "$\n", - "E[T|e(x), X] = E[T|X] = e(x)\n", - "$\n", + "while the law of iterated expectations gives\n", + "\n", + "$$\n", + "P(T=1\\mid e(X))=E[P(T=1\\mid X)\\mid e(X)]=e(X).\n", + "$$\n", "\n", - "We use the fact that $e(x)$ is just a function of X, so conditioning on it gives no further information after we've conditioned on X itself. Then, we use the definition of the propensity score $E[T|X]$. \n", + "Thus $T \\perp X \\mid e(X)$. This establishes covariate balance, but it does not yet mention the potential outcomes.\n", "\n", - "For the right hand side, we will use the law of iterated expectations $E[A] = E[E[A|B]]$. This law says that we can compute the expected value of A by looking at the value of A broken down by B and then averaging that. \n", + "Now assume conditional exchangeability, $(Y_0,Y_1) \\perp T \\mid X$. Applying iterated expectations again,\n", "\n", - "$\n", - "E[T|e(x)] = E[E[T|e(x),X]|e(x)] = E[e(x)|e(x)] = e(x)\n", - "$\n", + "$$\n", + "\\begin{aligned}\n", + "P(T=1\\mid Y_0,Y_1,e(X))\n", + "&=E[P(T=1\\mid Y_0,Y_1,X,e(X))\\mid Y_0,Y_1,e(X)]\\\\\n", + "&=E[P(T=1\\mid X)\\mid Y_0,Y_1,e(X)]\\\\\n", + "&=e(X).\n", + "\\end{aligned}\n", + "$$\n", "\n", - "The first equality comes from the law of iterated expectations. The second comes from what we've figured out when dealing with the left hand side. Since both the left and right hand side equals, $e(x)$, this equation is trivially true.\n", + "The second equality uses conditional exchangeability; the last uses the definition of the propensity score and the fact that we are conditioning on $e(X)$. Since $P(T=1\\mid e(X))=e(X)$ as well, we obtain $(Y_0,Y_1) \\perp T \\mid e(X)$. Positivity, $0