Applied Econometrics - Definitive Lecture Notes

Course Logistics and Overview

  • Course Identification: Applied Econometrics, taught by Fabian Krüger (primary lecturer) and Marc-Oliver Pohle (lecturer), with tutorials led by Marc-Oliver Pohle and Sophia Siefert at KIT (Karlsruhe Institute of Technology – The Research University in the Helmholtz Association).
  • Course Objectives: Focuses on econometrics for causal inference using both experimental data and observational data.
  • Schedule and Format:
    • Lectures: Weekly on Fridays, 09:45 – 11:15, Building 05.20, Room 1C-04.
    • Tutorials: Most weeks on Fridays, 11:30 – 13:00, same room as the lecture. Problem sets are posted on ILIAS approximately one week in advance and cover both econometric theory and R implementation.
  • Grading and Assessment:
    • Based on a 90-minute written exam.
    • Exam Dates: March 3, 2026 (14:00–15:30) and April 24, 2026 (preliminary date, available as a first attempt / offen für Erstschreiber).
    • Exam Structure: Covers analytical derivations (e.g., deriving formulas, computing estimators in numerical examples) and conceptual questions (e.g., comparing concepts, interpreting R output). Active R coding is not tested directly on the exam.
  • Main Course References:
    • Primary textbook: Ding, P. (2024), A First Course in Causal Inference, Chapman & Hall/CRC, Texts in Statistical Science.
    • Synthetic control reference: Abadie, A., Diamond, A., and Hainmueller, J. (2010), Synthetic Control Methods for Comparative Case Studies: Estimating the Effect of California's Tobacco Control Program, Journal of the American Statistical Association.

Linear Regression and Pearson Correlation

  • Two Goals of Econometric Analysis:
    • Prediction: Assessing the status quo or expected outcome given specific characteristics (e.g., "What is the expected rent for a flat, given its size, location, and equipment?").
    • Causality: Answering counterfactual or "what-if" questions regarding interventions (e.g., "How would the flat's rent change if the flat was newly renovated?").
  • Bivariate Linear Regression Model:
    • General non-parametric relationship between random variables XX and YY: E(Y∣X)=f(X)E(Y|X) = f(X) or Y=f(X)+ωY = f(X) + \omega.
    • Linear restriction assumes E(Y∣X)=ε+ϑXE(Y|X) = \varepsilon + \vartheta X or Y=ε+ϑX+ωY = \varepsilon + \vartheta X + \omega.
    • The random error term ω\omega is centered (E(ω)=0E(\omega) = 0) and uncorrelated with XX (cov(X,ω)=0\text{cov}(X, \omega) = 0).
  • Ordinary Least Squares (OLS) Derivation:
    • Parameter vector (ε,ϑ)(\varepsilon, \vartheta) minimizes the expected squared error:     (ε,ϑ)=arg⁡min⁡a,bE[(Y−(a+bX))2](\varepsilon, \vartheta) = \arg\min_{a,b} E[(Y - (a + bX))^2]
    • Solving the first-order conditions yields the population OLS coefficients:     ϑ=cov(X,Y)var(X)\vartheta = \frac{\text{cov}(X,Y)}{\text{var}(X)}ε=E(Y)−ϑE(X)\varepsilon = E(Y) - \vartheta E(X)
  • Coefficient Interpretation:
    • Intercept ε\varepsilon: Baseline expected value of YY when X=0X = 0.
    • Slope ϑ\vartheta: Modeled linear effect of a one-unit change in XX on YY.
    • Statistical Significance: Under the assumption that ω∼N(0,σ2)\omega \sim N(0, \sigma^2), the hypothesis H0:ϑ=0H_0: \vartheta = 0 vs H1:ϑ≠0H_1: \vartheta \neq 0 is tested using a t-test. Rejection at a significance level (e.g., 5%5\%) indicates a statistically significant linear relationship.
  • Relationship to Pearson Correlation Coefficient:
    • Pearson correlation coefficient ϖXY=cov(X,Y)var(X)var(Y)\varpi_{XY} = \frac{\text{cov}(X,Y)}{\sqrt{\text{var}(X)}\sqrt{\text{var}(Y)}}.
    • Slope ϑ\vartheta expressed via correlation:     ϑ=ϖXYvar(Y)var(X)\vartheta = \varpi_{XY} \frac{\sqrt{\text{var}(Y)}}{\sqrt{\text{var}(X)}}
    • ϖXY∈[−1,1]\varpi_{XY} \in [-1, 1], where ϖXY=1\varpi_{XY} = 1 indicates perfect positive linear dependency (Y=cX,c>0Y = cX, c > 0), ϖXY=0\varpi_{XY} = 0 indicates no linear association, and ϖXY=−1\varpi_{XY} = -1 indicates perfect negative linear dependency (Y=cX,c<0Y = cX, c < 0).
    • Key Limitation: Pearson correlation is symmetric (ϖXY=ϖYX\varpi_{XY} = \varpi_{YX}) and measures mutual co-movement, not directional causality. Because ϑ\vartheta is a rescaled version of ϖXY\varpi_{XY}, standard simple linear regression reflects correlation rather than causation.
  • Multiple Linear Regression with Two Regressors:
    • Model: Y=ε+ϑX+ϱZ+ωY = \varepsilon + \vartheta X + \varrho Z + \omega.
    • ϑ\vartheta represents the modeled effect of XX on YY controlling for ZZ (holding ZZ fixed).
    • Example: If YY is apartment price, XX is size, and ZZ is condition, ϑ\vartheta isolates the price increase per unit size for apartments in identical condition.

Sources of Correlation and Non-Causality

  • Five Mechanisms Generating Correlation Between XX and YY:
    1. XX has a direct causal effect on YY (X→YX \rightarrow Y).
    2. YY has a direct causal effect on XX (Y→XY \rightarrow X).
    3. A third variable ZZ causes both XX and YY (X←Z→YX \leftarrow Z \rightarrow Y; confounding / omitted variable bias).
    4. Selection bias: Analyzing a non-representative subset of the population with exceptional behavior in XX and YY.
    5. XX has an indirect causal effect on YY (X→Z→YX \rightarrow Z \rightarrow Y).
  • Empirical Example: Spurious Correlation (Temperature vs Life Expectancy):
    • Data: X=X = global average temperature in °C\text{°C}, Y=Y = global average life expectancy in years across n=63n = 63 annual observations (1960–2022).
    • Correlation ϖXY=0.92\varpi_{XY} = 0.92.
    • Simple OLS regression output:
    • Intercept: −166.9425-166.9425 (Std. Error=12.3923\text{Std. Error} = 12.3923, t=−13.47t = -13.47, p<2×10−16p < 2 \times 10^{-16}).
    • Slope (glob_temp_world): 16.126516.1265 (Std. Error=0.8624\text{Std. Error} = 0.8624, t=18.70t = 18.70, p<2×10−16p < 2 \times 10^{-16}).
    • R2=0.8515R^2 = 0.8515, Adjusted R2=0.8490R^2 = 0.8490, Residual standard error: 2.2452.245 on 6161 degrees of freedom.
    • Causal Fallacy: This does not imply that a 1 °C1\,\text{°C} temperature increase causes a 16-year16\text{-year} increase in life expectancy. Both variables increase over time due to economic development and technological progress.
    • Multiple OLS regression controlling for year (ZZ):
    • Intercept: −613.41870-613.41870 (Std. Error=26.10707\text{Std. Error} = 26.10707, t=−23.496t = -23.496, p<2×10−16p < 2 \times 10^{-16}).
    • year: 0.362180.36218 (Std. Error=0.02077\text{Std. Error} = 0.02077, t=17.434t = 17.434, p<2×10−16p < 2 \times 10^{-16}).
    • glob_temp_world: −2.99092-2.99092 (Std. Error=1.15200\text{Std. Error} = 1.15200, t=−2.596t = -2.596, p=0.0118p = 0.0118).
    • R2=0.9755R^2 = 0.9755, Adjusted R2=0.9747R^2 = 0.9747, Residual standard error: 0.9190.919 on 6060 degrees of freedom.
    • Controlling for time flips the coefficient of temperature from positive (+16.13+16.13) to negative (−2.99-2.99).
  • Empirical Example: LaLonde Job Training Dataset:
    • Data: n=445n = 445 observations evaluating a job training program (treatment X∈{0,1}X \in \{0,1\}) on yearly earnings in 1978 (RE78 YY).
    • Simple OLS (RE78 ~ treatment):
    • Intercept: 2155421554.
    • treatment: −15205-15205.
    • Multiple OLS (RE78 ~ . controlling for age, education, Black, Hispanic, married, nodegree, RE74, RE75):
    • Intercept: −129.7428-129.7428.
    • treatment: +751.9464+751.9464
    • age: −83.5656-83.5656, education: 592.6102592.6102, Black: −570.9280-570.9280, Hispanic: 2163.28122163.2812, married: 1240.51951240.5195, nodegree: 590.4669590.4669, RE74: 0.27810.2781, RE75: 0.5681$.\n - Controlling for background characteristics reverses the estimated training effect from -15205toto+751.95.\n\n# Contingency Tables and Binary Risk Measures\n\n- **Contingency Table Framework**:\n - Binary treatment/influencing variable Z \in {0, 1}andbinaryoutcomeand binary outcomeY \in {0, 1}.\n - Population joint probability distribution p_{zy} = P(Z = z, Y = y), summarized as:\n - Z = 1::p_{11}((Y=1),),p_{10}((Y=0).\n - Z = 0::p_{01}((Y=1),),p_{00}((Y=0).\n- **Probability/Risk Association Measures**:\n - **Risk Difference (RD)**:\n    \text{RD} = P(Y = 1|Z = 1) - P(Y = 1|Z = 0) = \frac{p_{11}}{p_{11} + p_{10}} - \frac{p_{01}}{p_{01} + p_{00}}\n - **Risk Ratio (RR)**:\n    \text{RR} = \frac{P(Y = 1|Z = 1)}{P(Y = 1|Z = 0)} = \frac{p_{11} / (p_{11} + p_{10})}{p_{01} / (p_{01} + p_{00})}\n - **Odds Ratio (OR)**:\n    \text{OR} = \frac{P(Y = 1|Z = 1) / P(Y = 0|Z = 1)}{P(Y = 1|Z = 0) / P(Y = 0|Z = 0)} = \frac{p_{11} p_{00}}{p_{10} p_{01}}\n- **Mathematical Equivalences**:\n - Independence between ZandandYisequivalenttois equivalent to\text{RD} = 0 \iff \text{RR} = 1 \iff \text{OR} = 1$.
    • Assuming all pzy>0p_{zy} > 0, \text{RD} > 0 \iff \text{RR} > 1 \iff \text{OR} > 1$.\n- **Empirical Estimation**:\n - For niidpairsiid pairs(Z_1, Y_1), \dots, (Z_n, Y_n),letcellcountsbe, let cell counts ben_{zy} = #{i : Z_i = z, Y_i = y}.\n - Probabilities p_{zy}areestimatedviasamplerelativefrequenciesare estimated via sample relative frequencies\hat{p}{zy} = \frac{n{zy}}{n}.\n\n# The Yule-Simpson Paradox\n\n- **Definition**: A situation where the aggregate modeled association between ZandandYhasanoppositesigncomparedtotheconditionalassociationsbetweenhas an opposite sign compared to the conditional associations betweenZandandYacrossallstrataofathirdcovariateacross all strata of a third covariateX.\n- **Kidney Stones Empirical Example**:\n - Sample of n = 700patientswithkidneystonestreatedviatwosurgicalprocedurespatients with kidney stones treated via two surgical proceduresZ:\n - Z = 1: Open surgical procedure.\n - Z = 0: Small puncture procedure (*Minimal Methode*).\n - Outcome Y = 1(success),(success),Y = 0 (failure).\n - Aggregated Data Table:\n - Z = 1::n_{11} = 273,,n_{10} = 77(Total(Total350;Successrate; Success rate273 / 350 = 78.0\%\n - Z = 0::n_{01} = 289,,n_{00} = 61(Total(Total350;Successrate; Success rate289 / 350 = 82.57\%\n - Aggregated Risk Difference:\n      \widehat{\text{RD}} = \frac{273}{350} - \frac{289}{350} = 78.0\% - 82.57\% = -4.57\%\n - Unadjusted data indicates that the small puncture procedure (Z=0)issuperiorby) is superior by4.57\text{ percentage points}.\n - Conditioning on Kidney Stone Size X((X = 1ifdiameterif diameter< 2\,\text{cm}[small];[small];X = 0ifdiameterif diameter\ge 2\,\text{cm} [large]):\n - Small Stones (X = 1):\n - Z = 1::n_{11} = 81,,n_{10} = 6(Total(Total87;Successrate; Success rate81 / 87 = 93.10\%\n - Z = 0::n_{01} = 234,,n_{00} = 36(Total(Total270;Successrate; Success rate234 / 270 = 86.67\%\n - \widehat{\text{RD}}{|X=1} = \frac{81}{87} - \frac{234}{270} = 93.10\% - 86.67\% = +6.44\%\n - Large Stones (X = 0):\n - Z = 1::n{11} = 192,,n_{10} = 71(Total(Total263;Successrate; Success rate192 / 263 = 73.00\%\n - Z = 0::n_{01} = 55,,n_{00} = 25(Total(Total80;Successrate; Success rate55 / 80 = 68.75\%\n - \widehat{\text{RD}}{|X=0} = \frac{192}{263} - \frac{55}{80} = 73.00\% - 68.75\% = +4.25\%\n - **Mechanism**: The open surgical procedure (Z=1)wasdisproportionatelyassignedtoseverecases() was disproportionately assigned to severe cases (263ofof350opensurgerieswereonlargestones,open surgeries were on large stones,75.14\%),pullingdownitsaggregatesuccessrate.Thesmallpunctureprocedure(), pulling down its aggregate success rate. The small puncture procedure (Z=0)wasmostlyassignedtomildcases() was mostly assigned to mild cases (270ofof350punctureprocedureswereonsmallstones,puncture procedures were on small stones,77.14\%).\n - **Decomposition of Underlying Relationships**:\n - Effect of XononZ::P(Z=1|X=1) - P(Z=1|X=0) = \frac{87}{357} - \frac{263}{343} = 24.37\% - 76.68\% = -52.31\% \approx -53\%\n - Effect of XononYgivengivenZ=0::P(Y=1|X=1, Z=0) - P(Y=1|X=0, Z=0) = 86.67\% - 68.75\% = +17.92\% \approx 18\%\n - Effect of XononYgivengivenZ=1::P(Y=1|X=1, Z=1) - P(Y=1|X=0, Z=1) = 93.10\% - 73.00\% = +20.10\% \approx 20\%\n - Because the association between XandandZandbetweenand betweenXandandYislargerthanthedirecteffectofis larger than the direct effect ofZononY,theindirectnegativeassociationvia, the indirect negative association viaXmasksthepositivedirecteffectofmasks the positive direct effect ofZononY.\n- **UC Berkeley Admissions Example (Bickel et al., 1975)**:\n - Aggregated data showed that gender Zhadasignificantassociationwithadmissionstatushad a significant association with admission statusY, favoring male applicants.\n - Controlling for department choice X (the 6 largest graduate departments), the direct gender disparity vanished. Female applicants applied disproportionately to departments with low overall admission rates.\n- **Origins and Prevention of Simpson's Paradox**:\n - *Data Limitations*: Systematic baseline differences between treated (Z=1)andcontrol() and control (Z=0) units in observational settings.\n - *Analytical Limitation*: Failing to account for counterfactual potential outcomes for each unit under treatment vs control.\n\n# Experimental versus Observational Data\n\n- **Experimental Data**:\n - The researcher directly controls treatment assignment Z_i and uses explicit randomization (e.g., coin flips) to allocate subjects into treatment and control groups.\n - Defines the benchmark or "gold standard" for causal inference.\n - **Ethical Constraints**:\n - Treatment must not intentionally harm participants.\n - Withholding beneficial treatments from the control group must be ethically defensible.\n - **Practical/Design Constraints**:\n - Requires researcher control over treatment implementation.\n - Requires tracking participants over extended time horizons for long-term outcomes.\n - Requires infrastructure, compliance tracking, and funding.\n- **Observational Data**:\n - Recorded values are outside the researcher's control; treatment status Z is selected by subjects or nature.\n - Sources: Administrative records, census data, social security files (e.g., IAB Nuremberg), surveys, commercial market data, central bank series (e.g., ECB, Bundesbank, FRED).\n - Prone to selection bias, confounding, and non-random compliance.\n\n# The Potential Outcomes Framework (Rubin Causal Model)\n\n- **Notation and Setup**:\n - Experimental units indexed by i = 1, \dots, n.\n - Binary treatment indicator Z_i \in {0, 1}((Z_i = 1fortreatment,for treatment,Z_i = 0 for control).\n - **Interventions**:\n - *Well-defined*: Clear operational steps (e.g., taking an aspirin vs not taking an aspirin).\n - *Ill-defined*: Causes that cannot be directly manipulated (e.g., Pearl 2018 critique on obesity/BMI, which can only be manipulated indirectly through diet, exercise, or surgery).\n- **Counterfactual Potential Outcomes**:\n - Y_i(1):Potentialoutcomeforunit: Potential outcome for unitiundertreatment(under treatment (Z_i = 1).\n - Y_i(0):Potentialoutcomeforunit: Potential outcome for unitiundercontrol(under control (Z_i = 0).\n- **Stable Unit Treatment Value Assumption (SUTVA)**:\n 1. **No Interference**: Unit i′spotentialoutcomesareunaffectedbythetreatmentassignmentsofotherunits's potential outcomes are unaffected by the treatment assignments of other unitsj \neq i((Y_i(z_1, \dots, z_n) = Y_i(z_i)).\n - *Counterexample*: Social network spillovers where an ad shown to a user influences a friend's purchase decision.\n 2. **Consistency**: Treatment is unique and well-defined without hidden variations in treatment intensity.\n - *Counterexample*: Evaluating "college degree" where quality, major, and rigor vary widely across institutions.\n- **Science Table**:\n - An n \times 2arraylistingarray listing\left[Y_i(1), Y_i(0)\right]forallfor alli = 1, \dots, n.\n - Fundamental Problem of Causal Inference: For each unit i, only one potential outcome is observable; the other is counterfactual and missing.\n- **Definitions of Causal Effects**:\n - **Individual Causal Effect**: \omega_i = Y_i(1) - Y_i(0).\n - **Average Causal Effect (ACE / ATE)**:\n    \omega = \frac{1}{n} \sum{i=1}^n \omega_i = \frac{1}{n} \sum_{i=1}^n Y_i(1) - \frac{1}{n} \sum_{i=1}^n Y_i(0) = \bar{Y}(1) - \bar{Y}(0)\n- **Experimental Unit vs Physical Unit**:\n - A physical unit (a single individual) observed across two different time points represents two distinct experimental units (i_{\text{before}}andandi_{\text{after}}$).
    • Before decision: Yi,before(0)=1Y_{i,\text{before}}(0) = 1, Yi,before(1)=?Y_{i,\text{before}}(1) = ?
    • After decision: Yi,after(0)=? Y_{i,\text{after}}(0) = ?\,, Yi,after(1)=0Y_{i,\text{after}}(1) = 0
    • Replacing missing outcomes with assumed values demonstrates that causal effects can vary across time for the same physical unit.

Non-Existence of the Yule-Simpson Paradox under Potential Outcomes

  • Mathematical Proof:
    • Let discrete covariate Xi∈{0,1}X_i \in \{0, 1\} partition units into two subgroups.
    • Subgroup Average Causal Effect for stratum x∈{0,1}x \in \{0, 1\}:     ωx=∑i=1n1(Xi=x)(Yi(1)−Yi(0))∑i=1n1(Xi=x)\omega_x = \frac{\sum_{i=1}^n \mathbf{1}(X_i = x) (Y_i(1) - Y_i(0))}{\sum_{i=1}^n \mathbf{1}(X_i = x)}
    • Proportion of units in stratum xx: εx=∑i=1n1(Xi=x)n\varepsilon_x = \frac{\sum_{i=1}^n \mathbf{1}(X_i = x)}{n}.
    • The overall ACE is a convex linear combination of subgroup ACEs:     ω=ε0ω0+ε1ω1\omega = \varepsilon_0 \omega_0 + \varepsilon_1 \omega_1
    • Implication: If ω0>0\omega_0 > 0 and ω1>0\omega_1 > 0, then ω>0\omega > 0 necessarily holds. Simpson's Paradox cannot occur when analyzing true potential outcomes; it arises solely from confounding in observed associations.

Treatment Assignment Mechanisms and Observed Outcomes

  • Observation Mechanism:
    • The observed outcome YiY_i is linked to potential outcomes via treatment assignment ZiZ_i:     Yi=ZiYi(1)+(1−Zi)Yi(0)=Yi(0)+Zi(Yi(1)−Yi(0))=Yi(0)+ZiωiY_i = Z_i Y_i(1) + (1 - Z_i) Y_i(0) = Y_i(0) + Z_i (Y_i(1) - Y_i(0)) = Y_i(0) + Z_i \omega_i
    • The missing/counterfactual outcome is:     Yioth=(1−Zi)Yi(1)+ZiYi(0)Y_i^{\text{oth}} = (1 - Z_i) Y_i(1) + Z_i Y_i(0)
  • Doctor Simulation Example (Treatment Assignment Impact):
    • Setup: n=1000n = 1000 patients (500500 assigned to Doctor 1, 500500 to Doctor 2). Baseline health Y0∼N(0,1)Y_0 \sim N(0,1). Individual treatment effects τi=−0.5+ηi\tau_i = -0.5 + \eta_i, where ηi∼N(0,1)\eta_i \sim N(0,1). Mean true ACE is −0.5-0.5 for both doctors (τˉ1:500=−0.4708\bar{\tau}_{1:500} = -0.4708, τˉ501:1000=−0.5180\bar{\tau}_{501:1000} = -0.5180).
    • Perfect Doctor (Doctor 1): Assigns treatment Zi=1Z_i = 1 if and only if τi>0\tau_i > 0.
    • Observed difference in sample means: YˉZ=1−YˉZ=0=+0.6651\bar{Y}_{Z=1} - \bar{Y}_{Z=0} = +0.6651.
    • Result: Misleading positive association despite a negative average causal effect.
    • Clueless Doctor (Doctor 2): Assigns treatment Zi∈{0,1}Z_i \in \{0,1\} via independent coin tosses (P(Zi=1)=0.5P(Z_i = 1) = 0.5).
    • Observed difference in sample means: YˉZ=1−YˉZ=0=−0.5586\bar{Y}_{Z=1} - \bar{Y}_{Z=0} = -0.5586.
    • Result: Unbiased estimate close to the true population ACE (−0.50-0.50).

Completely Randomized Experiments (CRE)

  • Definition and Probability Distribution:
    • Sample size nn, fixed number of treated units n1n_1, fixed number of control units n_0 = n - n_1$.\n - Total number of possible treatment assignment vectors: M = \binom{n}{n_1} = \frac{n!}{n_0! n_1!}.\n - A Completely Randomized Experiment (CRE) selects every treatment assignment vector \mathbf{z} \in {0,1}^nsatisfyingsatisfying\sum_{i=1}^n z_i = n_1 with equal probability:\n    P(\mathbf{Z} = \mathbf{z}) = \frac{1}{\binom{n}{n_1}}\n - If potential outcomes are viewed as random variables, CRE assumes independence:\n    P(\mathbf{Z} = \mathbf{z} | \mathbf{Y}(0), \mathbf{Y}(1)) = \frac{1}{\binom{n}{n_1}}\n- **CRE versus Bernoulli Randomized Experiments (BRE)**:\n - In a BRE, each Z_i \overset{iid}{\sim} \text{Bernoulli}(p),renderingthetotaltreatedcount, rendering the total treated countn_1 \sim \text{Binomial}(n, p) random.\n - Conditioning a BRE on the observed number of treated units n_1 yields a CRE.\n\n# The Fisher Randomization Test (FRT)\n\n- **Setting and Sharp Null Hypothesis**:\n - Fisher's Sharp Null Hypothesis: H_0^F: Y_i(1) = Y_i(0)forallfor alli = 1, \dots, n (all individual treatment effects are identically zero).\n - Under H_0^F,bothpotentialoutcomesarefullyknownforallunits(, both potential outcomes are fully known for all units (Y_i(1) = Y_i(0) = Y_i).\n- **Test Statistic**:\n - Difference-in-means statistic: \hat{\omega}(\mathbf{Z}, \mathbf{Y}) = \hat{\bar{Y}}(1) - \hat{\bar{Y}}(0), where:\n    \hat{\bar{Y}}(1) = \frac{1}{n_1} \sum_{i: Z_i = 1} Y_i = \frac{1}{n_1} \sum_{i=1}^n Z_i Y_i\n    \hat{\bar{Y}}(0) = \frac{1}{n_0} \sum_{i: Z_i = 0} Y_i = \frac{1}{n_0} \sum_{i=1}^n (1 - Z_i) Y_i\n- **p-Value Formulas**:\n - Two-sided exact p-value:\n    p_{\text{FRT}} = \frac{1}{M} \sum_{m=1}^M \mathbf{1}\left(|\hat{\omega}(\mathbf{z}m, \mathbf{Y})| \ge |\hat{\omega}(\mathbf{z}, \mathbf{Y})|\right)\n - One-sided exact p-value (testing for positive effect):\n    p{\text{FRT}} = \frac{1}{M} \sum_{m=1}^M \mathbf{1}\left(\hat{\omega}(\mathbf{z}m, \mathbf{Y}) \ge \hat{\omega}(\mathbf{z}, \mathbf{Y})\right)\n- **Small Numerical Example (Job Training Subset, n=5, n_1=3, M=10)**:\n - Units earnings: 2484.55, 12558.00, 743.67, 0.00, 275.57.Truetreatmentvector:. True treatment vector:(1, 1, 1, 0, 0).\n - Observed difference-in-means: \hat{\omega} = 5124.289\n - Permutation difference-in-means distribution across all 10 allocations:\n 1. (1,1,1,0,0) \rightarrow 5124.289 (True assignment)\n 2. (1,1,0,1,0) \rightarrow 4504.567\n 3. (1,1,0,0,1) \rightarrow 4734.205\n 4. (1,0,1,1,0) \rightarrow -5340.711\n 5. (1,0,1,0,1) \rightarrow -5111.072\n 6. (1,0,0,1,1) \rightarrow -5730.795\n 7. (0,1,1,1,0) \rightarrow 3053.831\n 8. (0,1,1,0,1) \rightarrow 3283.469\n 9. (0,1,0,1,1) \rightarrow 2663.747\n 10. (0,0,1,1,1) \rightarrow -7181.531\n - Results: Two-sided p = 4 / 10 = 0.40;One−sided; One-sidedp = 1 / 10 = 0.10.Cannotreject. Cannot rejectH_0^F due to small sample size.\n- **Full Sample Monte Carlo Approximation (n=445, n_1=185)**:\n - Exact M = \binom{445}{185}iscomputationallyinfeasible.Usingis computationally infeasible. UsingN{MC} = 10,000 random permutations:\n - Observed true difference-in-means: \hat{\omega} = 1794.34\n - Monte Carlo p-values: Two-sided p = 0.0042;One−sided; One-sidedp = 0.0023.\n- **Asymptotic Normal Approximation**:\n - Under H_0^F,,\frac{\hat{\omega}(\mathbf{Z}, \mathbf{Y})}{\sqrt{\frac{n}{n_0 n_1} s^2}} \xrightarrow{d} N(0, 1),where, wheres^2 = \frac{1}{n-1} \sum_{i=1}^n (Y_i - \bar{Y})^2\n - Approximate one-sided p-value:\n    p_{\text{FRT}} \approx 1 - \Phi\left( \frac{\hat{\omega}(\mathbf{z}, \mathbf{Y})}{\sqrt{\frac{n}{n_0 n_1} s^2}} \right)\n - Job training asymptotic p-value: 0.002453245.\n- **Extensions**:\n - Generalized null hypothesis H_0(\boldsymbol{\omega}): Y_i(1) - Y_i(0) = \varepsilon_iforavectorofeffectsfor a vector of effects\boldsymbol{\omega} = (\varepsilon_1, \dots, \varepsilon_n).\n\n# Estimation of the Average Causal Effect (ACE)\n\n- **Setting**: CRE with fixed potential outcomes Y_i(1), Y_i(0)orconditionedonpotentialoutcomes.Randomnessstemsentirelyfromtreatmentassignmentvectoror conditioned on potential outcomes. Randomness stems entirely from treatment assignment vector\mathbf{Z}.\n- **Difference-in-Means Estimator**:\n  \hat{\omega} = \hat{\bar{Y}}(1) - \hat{\bar{Y}}(0) = \frac{1}{n_1} \sum_{i=1}^n Z_i Y_i - \frac{1}{n_0} \sum_{i=1}^n (1 - Z_i) Y_i\n- **Proof of Unbiasedness**:\n - Since E[Z_i] = \frac{n_1}{n}andandE[1 - Z_i] = \frac{n_0}{n}:\n    E[\hat{\omega}] = E\left[ \frac{1}{n_1} \sum_{i=1}^n Z_i Y_i(1) - \frac{1}{n_0} \sum_{i=1}^n (1 - Z_i) Y_i(0) \right]\n    E[\hat{\omega}] = \frac{1}{n_1} \sum_{i=1}^n \frac{n_1}{n} Y_i(1) - \frac{1}{n_0} \sum_{i=1}^n \frac{n_0}{n} Y_i(0) = \bar{Y}(1) - \bar{Y}(0) = \omega\n\n# Variance of the Difference-in-Means Estimator\n\n- **Population Potential Outcome Variances and Covariances**:\n  S^2(1) = \frac{1}{n-1} \sum_{i=1}^n (Y_i(1) - \bar{Y}(1))^2\n  S^2(0) = \frac{1}{n-1} \sum_{i=1}^n (Y_i(0) - \bar{Y}(0))^2\n  S(1, 0) = \frac{1}{n-1} \sum_{i=1}^n (Y_i(1) - \bar{Y}(1))(Y_i(0) - \bar{Y}(0))\n  S^2(\omega) = \frac{1}{n-1} \sum_{i=1}^n (\omega_i - \omega)^2\n- **Algebraic Identity**:\n  2 S(1,0) = S^2(1) + S^2(0) - S^2(\omega)\n- **Exact Variance Formulas**:\n  \text{var}(\hat{\omega}) = \frac{1}{n} \left[ \frac{n_0}{n_1} S^2(1) + \frac{n_1}{n_0} S^2(0) + 2 S(1, 0) \right]\n  \text{var}(\hat{\omega}) = \frac{S^2(1)}{n_1} + \frac{S^2(0)}{n_0} - \frac{S^2(\omega)}{n}\n- **Properties of Variance**:\n - Larger sample size n lowers variance.\n - Optimal sample allocation ratio: \frac{n_0}{n_1} = \sqrt{\frac{S^2(0)}{S^2(1)}}.\n - Higher variation in individual treatment effects S^2(\omega) *reduces* variance across random treatment assignments.\n- **Supermarket Simulation Example (n=100, n_1=60, n_0=40)**:\n - Baseline Y_0 \sim \text{Exp}(0.1) sorted in decreasing order.\n - **Case 1 (Same Order)**: Y_1 = Y_0 + 10((\omega_i = 10constant).constant).S(1,0) = 89.09,,S^2(\omega) = 0.True. True\text{var}(\hat{\omega}) = 3.725\n - **Case 2 (Opposite Order)**: Y_1sortedinincreasingorder.sorted in increasing order.S(1,0) = -59.91,,S^2(\omega)maximal.Truemaximal. True\text{var}(\hat{\omega}) = 0.738\n - **Case 3 (Random Order)**: Y_1randomlyshuffled.randomly shuffled.S(1,0) = 4.00.True. True\text{var}(\hat{\omega}) = 2.013\n\n# Variance Estimation and Asymptotic Confidence Intervals\n\n- **Sample Variance Estimators**:\n  \hat{S}^2(1) = \frac{1}{n_1 - 1} \sum_{i=1}^n Z_i (Y_i - \hat{\bar{Y}}(1))^2\n  \hat{S}^2(0) = \frac{1}{n_0 - 1} \sum_{i=1}^n (1 - Z_i) (Y_i - \hat{\bar{Y}}(0))^2\n - Unobserved terms: S(1,0)andandS^2(\omega) cannot be identified from observed data because no individual has both potential outcomes recorded.\n- **Conservative Variance Estimator**:\n  \hat{V} = \frac{\hat{S}^2(1)}{n_1} + \frac{\hat{S}^2(0)}{n_0}\n- **Expectation and Bias of Variance Estimator**:\n  E[\hat{V}] - \text{var}(\hat{\omega}) = \frac{S^2(\omega)}{n} \ge 0\n - \hat{V}isunbiasediftreatmenteffectsareconstant(is unbiased if treatment effects are constant (S^2(\omega) = 0); otherwise, it overestimates the true variance on average (conservative estimator).\n - Simulation average estimated variance \bar{\hat{V}} across 100,000 iterations:\n - Same order: Estimated 3.711(True(True3.725\n - Opposite order: Estimated 3.709(True(True0.738\n - Random order: Estimated 3.710(True(True2.013\n- **Asymptotic Distribution and Confidence Intervals**:\n - Under regularity conditions, \frac{\hat{\omega} - \omega}{\sqrt{\text{var}(\hat{\omega})}} \xrightarrow{d} N(0, 1).\n - Approximate (1 - \alpha)confidenceintervalforACEconfidence interval for ACE\omega:\n    \left[ \hat{\omega} - z_{1 - \alpha/2} \sqrt{\hat{V}}, \; \hat{\omega} + z_{1 - \alpha/2} \sqrt{\hat{V}} \right]\n - Simulation empirical coverage for nominal 95\% CI:\n - Same order: 0.946\n - Opposite order: 1.000\n - Random order: 0.990\n- **Hypothesis Test for Weak Null (H_0^W: \omega = 0)**:\n - Reject H_0^Wifif0isoutsidetheis outside the(1-\alpha) confidence interval.\n - Overestimating variance produces wider CIs, leading to conservative decision-making (lower risk of false positives, but reduced test power).\n\n# Stratification and Stratified Randomized Experiments (SRE)\n\n- **Notation and Framework**:\n - Discrete covariate X_i \in {1, \dots, K}.\n - Subgroup of units with X_i = kistheis thek\text{-th} stratum.\n - Stratum size: n^{[k]} = #{i : X_i = k};Stratumproportion:; Stratum proportion:\omega^{[k]} = n^{[k]} / n\n - Stratum treatment/control counts: n_1^{[k]} = #{i : X_i = k, Z_i = 1},,n_0^{[k]} = #{i : X_i = k, Z_i = 0}.\n- **Limitations of Unstratified CRE**:\n 1. Risk of zero cell counts (n_1^{[k]} = 0ororn_0^{[k]} = 0) in one or more strata.\n 2. Imbalance in stratum propensity scores e^{[k]} = n_1^{[k]} / n^{[k]}relativetooverallsampleratiorelative to overall sample ratioe = n_1 / n$.
  • Definition of Stratified Randomized Experiments (SRE):
    • An SRE fixes n1[k]n_1^{[k]} and n0[k]n_0^{[k]} for every stratum k=1,…,Kk = 1, \dots, K and independently conducts a CRE within each stratum.
    • Total possible assignments in SRE: MS=∏k=1K(n[k]n1[k])<(nn1)M_S = \prod_{k=1}^K \binom{n^{[k]}}{n_1^{[k]}} < \binom{n}{n_1}.
  • Stratified Difference-in-Means Estimator:   ω^S=∑k=1Kω[k]ω^[k]\hat{\omega}_S = \sum_{k=1}^K \omega^{[k]} \hat{\omega}^{[k]}ω^[k]=1n1[k]∑i:Xi=k,Zi=1Yi−1n0[k]∑i:Xi=k,Zi=0Yi\hat{\omega}^{[k]} = \frac{1}{n_1^{[k]}} \sum_{i: X_i = k, Z_i = 1} Y_i - \frac{1}{n_0^{[k]}} \sum_{i: X_i = k, Z_i = 0} Y_i
    • Generally, ω^S≠ω^\hat{\omega}_S \neq \hat{\omega}.

Fisher Randomization Test and Inference for SREs

  • Fisher Randomization Test in SRE:
    • Null Hypothesis H0F:Yi(1)=Yi(0)H_0^F: Y_i(1) = Y_i(0) for all i=1,…,ni = 1, \dots, n
    • Test statistic T(Z,Y,X)=ω^ST(\mathbf{Z}, \mathbf{Y}, \mathbf{X}) = \hat{\omega}_S
    • One-sided exact p-value:     pSFRT=1MS∑m=1MS1(ω^S(X,Y,zmS)≥ω^S(X,Y,zS))p_{\text{SFRT}} = \frac{1}{M_S} \sum_{m=1}^{M_S} \mathbf{1}\left( \hat{\omega}_S(\mathbf{X}, \mathbf{Y}, \mathbf{z}_m^S) \ge \hat{\omega}_S(\mathbf{X}, \mathbf{Y}, \mathbf{z}^S) \right)
  • Unbiasedness and Variance of ω^S\hat{\omega}_S:
    • $E[\hat{\omega}S] = \sum{k=1}^K \omega^{[k]} E[\hat{\omega}^{[k]}] = \sum_{k=1}^K \omega^{[k]} \omega^{[k]} = \omega\n - Exact Variance Formula:\n    \text{var}(\hat{\omega}S) = \sum{k=1}^K (\omega^{[k]})^2 \left[ \frac{S_{[k]}^2(1)}{n_1^{[k]}} + \frac{S_{[k]}^2(0)}{n_0^{[k]}} - \frac{S_{[k]}^2(\omega)}{n^{[k]}} \right]\n- **Conservative Variance Estimator for SRE**:\n  \hat{V}S = \sum{k=1}^K (\omega^{[k]})^2 \hat{V}{[k]} = \sum{k=1}^K (\omega^{[k]})^2 \left[ \frac{\hat{S}{[k]}^2(1)}{n_1^{[k]}} + \frac{\hat{S}{[k]}^2(0)}{n_0^{[k]}} \right]\n - Requires n_1^{[k]} \ge 2andandn_0^{[k]} \ge 2(atleast(at least4 observations per stratum) for sample variances to exist.\n\n# Comparison Between SRE and CRE\n\n- **Theoretical Efficiency Gain**:\n - Assume perfectly balanced strata (e^{[k]} = n_1^{[k]} / n^{[k]} = n_1 / n = eforallfor allk)andsufficientlylarge) and sufficiently largen^{[k]}.\n - Then \hat{\omega}S = \hat{\omega},andbothestimatorsareunbiasedfor, and both estimators are unbiased for\omega.\n - Variance Relationship:\n    \text{var}{\text{CRE}}(\hat{\omega}) - \text{var}{\text{SRE}}(\hat{\omega}_S) = \sum{k=1}^K \frac{\omega^{[k]}}{n} \left[ \sqrt{\frac{n_0}{n_1}} (\bar{Y}{[k]}(1) - \bar{Y}(1)) + \sqrt{\frac{n_1}{n_0}} (\bar{Y}{[k]}(0) - \bar{Y}(0)) \right]^2 \ge 0\n - **Conclusion**: The variance of the difference-in-means estimator in an SRE is strictly less than or equal to that in a CRE. The predictive power of XononY determines the magnitude of variance reduction.\n- **Simulation Example (n=400, K=5, n_1=250, n_0=150)**:\n - n^{[k]} = 80,,n_1^{[k]} = 50,,n_0^{[k]} = 30across5degreegroupsacross 5 degree groupsX_i \in {-2, -1, 0, 1, 2}.\n - Over 10,000 Monte Carlo simulations, \hat{\omega}{SRE}exhibitssignificantlytightersamplingdistributionaroundtrueACE(exhibits significantly tighter sampling distribution around true ACE (+10)than) than\hat{\omega}{CRE}.\n- **Optimal Choice of Strata Count K**:\n - Increasing K yields diminishing marginal efficiency returns.\n - Literature benchmark: K = 5isoftensufficient.Settingis often sufficient. SettingK = n/2 yields a matched-pairs experiment.\n\n# Post-Stratification\n\n- **Mechanism**:\n - If a CRE has already been executed, efficiency gains can be achieved via post-stratification.\n - Let \mathbf{n} = (n_1^{[k]}, n_0^{[k]}){k=1}^K represent the vector of realized treatment/control counts across strata.\n - Conditioning a CRE on \mathbf{n} yields the exact probability distribution of an SRE:\n    P{\text{CRE}}(\mathbf{Z} = \mathbf{z} | \mathbf{n}) = \frac{P_{\text{CRE}}(\mathbf{Z} = \mathbf{z}, \mathbf{n})}{P_{\text{CRE}}(\mathbf{n})} = \frac{1}{\prod_{k=1}^K \binom{n^{[k]}}{n_1^{[k]}}}\n- **Practical Application**:\n - Evaluate the observed assignment zagainstthesubsetofassignmentsyieldingidenticalrealizedstratumcountsagainst the subset of assignments yielding identical realized stratum counts\mathbf{n}ratherthanallrather than all\binom{n}{n_1} assignments.\n\n# Observational Data and Selection Bias\n\n- **Notation and Framework**:\n - Pre-treatment covariates X_i,binarytreatmentindicator, binary treatment indicatorZ_i \in {0, 1},observedoutcome, observed outcomeY_i,potentialoutcomes, potential outcomesY_i(1), Y_i(0).\n - Assume {(X_i, Z_i, Y_i(1), Y_i(0))}_{i=1}^n are iid.\n- **Treatment Effect Definitions**:\n - **Average Treatment Effect (ATE)**: \omega = E[Y(1) - Y(0)]\n - **Average Treatment Effect on the Treated (ATT)**:\n    \omega_T = E[Y(1) - Y(0) | Z = 1] = E[Y|Z = 1] - E[Y(0) | Z = 1]\n - **Average Treatment Effect on the Controls (ATC)**:\n    \omega_C = E[Y(1) - Y(0) | Z = 0] = E[Y(1) | Z = 0] - E[Y|Z = 0]\n - Weighted sum: \omega = P(Z = 1) \omega_T + (1 - P(Z = 1)) \omega_C\n- **Prima Facie Causal Effect (\omega_{PF})**:\n  \omega_{PF} = E[Y|Z = 1] - E[Y|Z = 0] = E[Y(1)|Z = 1] - E[Y(0)|Z = 0]\n - **Selection Bias Relations**:\n    \omega_{PF} - \omega_T = E[Y(0)|Z = 1] - E[Y(0)|Z = 0]\n    \omega_{PF} - \omega_C = E[Y(1)|Z = 1] - E[Y(1)|Z = 0]\n- **Streaming Service Hypothetical Example**:\n - Treatment Z=1(premiumaccount),(premium account),Z=0(freeaccount).(free account).P(Z=1) = 0.20.\n - Given expectations: E[Y(1)|Z=1] = 833,,E[Y(0)|Z=1] = 733,,E[Y(1)|Z=0] = 767,,E[Y(0)|Z=0] = 667\n - Calculations:\n - \omega_T = 833 - 733 = 100\n - \omega_C = 767 - 667 = 100\n - \omega = 0.2(100) + 0.8(100) = 100\n - \omega_{PF} = 833 - 667 = 166\n - Selection bias: \omega_{PF} - \omega_T = 733 - 667 = 66\,\text{minutes}. Prima facie effect overstates true ATE.\n- **Independent Treatment Assignment Case**:\n - If Z \perp!!!\perp {Y(1), Y(0)},then, then\omega = \omega_T = \omega_C = \omega_{PF}.\n\n# Identification of ATE Under Selection on Observables (Unconfoundedness)\n\n- **Conditions**:\n - **Selection on Observables (SoO) / Unconfoundedness**:\n    E[Y(0)|Z = 1, X] = E[Y(0)|Z = 0, X]\n    E[Y(1)|Z = 1, X] = E[Y(1)|Z = 0, X]\n - Equivalently (stricter): {Y(1), Y(0)} \perp!!!\perp Z \mid X\n- **Conditional Effects**:\n - Under SoO, \omega(X) = \omega_T(X) = \omega_C(X) = \omega_{PF}(X), where:\n    \omega_{PF}(X) = E[Y|X, Z = 1] - E[Y|X, Z = 0]\n- **Identification Theorem (Ding, Theorem 10.1)**:\n - Under SoO, ATE \omega is identified from observed data:\n    \omega = E[\omega(X)] = E\left[ E[Y|X, Z = 1] - E[Y|X, Z = 0] \right]\n    \omega = \int \left( E[Y|X = x, Z = 1] - E[Y|X = x, Z = 0] \right) f(x) dx\n - Discrete Covariate X formulation:\n    \omega = \sum_x E[Y|X = x, Z = 1] P(X = x) - \sum_x E[Y|X = x, Z = 0] P(X = x)\n- **Streaming Example with Confounder XandOmittedVariableand Omitted VariableW**:\n - W \in [0,1](wealth),(wealth),X \in [0,1](serviceinterest).Decisionrule:(service interest). Decision rule:Z = \mathbf{1}(W + X \ge 1).\n - Outcome distributions: Y(0) \sim U[a, b]withwitha = 400 + 200X, b = a + 400;;Y(1) \sim U[c, d]withwithc = a + 100, d = b + 100\n - Controlling for X alone satisfies SoO:\n    E[Y(0)|Z=1, X] = E[Y(0)|Z=0, X] = 600 + 200X\n    E[Y(1)|Z=1, X] = E[Y(1)|Z=0, X] = 700 + 200X\n - Controlling for W alone *fails* SoO (omitted variable bias):\n    E[Y(0)|W, Z=1] \neq E[Y(0)|W, Z=0]\n - For fixed wealth W,userswith, users withZ=0musthavelowinterestmust have low interestX < 1 - W,causing, causingE[Y(0)|W, Z=0]todecreaseaswealthto decrease as wealthW increases.\n\n# Estimating ATE Under Selection on Observables\n\n- **Approach 1: Stratification Based on Discrete Covariates**:\n - For discrete X_i \in {1, \dots, K}:\n    \hat{\omega} = \sum_{k=1}^K \varepsilon^{[k]} \hat{\omega}^{[k]}\n    \hat{\omega}^{[k]} = \frac{1}{n_1^{[k]}} \sum_{i: X_i = k, Z_i = 1} Y_i - \frac{1}{n_0^{[k]}} \sum_{i: X_i = k, Z_i = 0} Y_i\n    where \varepsilon^{[k]} = \frac{n_1^{[k]} + n_0^{[k]}}{n}.\n - **Hypothetical Video Game Example**:\n - Outcome Y =testscorepercentage;Treatmenttest score percentage; TreatmentZ = 1 (purchased video game).\n - Female sub-sample (52\%ofsample):of sample):\hat{\bar{Y}}{Z=1} = 60.54((n=10),),\hat{\bar{Y}}{Z=0} = 61.23((n=42))\Rightarrow \hat{\omega}^{[\text{female}]} = -0.69\n - Male sub-sample (48\%ofsample):of sample):\hat{\bar{Y}}{Z=1} = 53.18((n=24),),\hat{\bar{Y}}{Z=0} = 52.39((n=24))\Rightarrow \hat{\omega}^{[\text{male}]} = +0.79\n - Overall Stratified Estimator:\n      \hat{\omega} = 0.52 (60.54 - 61.23) + 0.48 (53.18 - 52.39) = 0.52 (-0.69) + 0.48 (0.79) \approx +0.02\n- **Approach 2: Outcome Regression**:\n - *Version 1 (Homogeneous Treatment Effect)*: Assume E[Y|Z, X] = \vartheta_0 + \vartheta_z Z + \boldsymbol{\vartheta}x^T X.\n    \omega(X) = E[Y|Z=1, X] - E[Y|Z=0, X] = \vartheta_z \implies \omega = \vartheta_z\n - *Version 2 (Heterogeneous Effect with Interaction)*: Assume E[Y|Z, X] = \vartheta_0 + \vartheta_z Z + \boldsymbol{\vartheta}_x^T X + \boldsymbol{\vartheta}{zx}^T X Z\n    \omega(X) = \vartheta_z + \boldsymbol{\vartheta}{zx}^T X \implies \omega = \vartheta_z + \boldsymbol{\vartheta}{zx}^T E[X]\n - Centering covariates (E[X] = 0)ensures) ensures\hat{\omega} = \hat{\vartheta}z directly.\n\n# OLS with Heteroskedastic Errors and Robust Standard Errors\n\n- **Linear Model Setup**:\n  Y_i = \boldsymbol{\vartheta}^T X_i + \varpi_i, \quad E[\varpi_i|X_i] = 0, \quad V(\varpi_i|X_i) = \varrho_i^2\n- **OLS Estimator Decomposition**:\n  \hat{\boldsymbol{\vartheta}} = \left( \sum{i=1}^n X_i X_i^T \right)^{-1} \sum_{i=1}^n X_i Y_i = \boldsymbol{\vartheta} + \left( \sum_{i=1}^n X_i X_i^T \right)^{-1} \sum_{i=1}^n X_i \varpi_i\n- **Properties**:\n - Unbiasedness: E[\hat{\boldsymbol{\vartheta}}|X_1, \dots, X_n] = \boldsymbol{\vartheta}\n - Sandwich Variance Formula:\n    V(\hat{\boldsymbol{\vartheta}}|X_1, \dots, X_n) = \frac{1}{n} \left( \frac{1}{n} \sum_{i=1}^n X_i X_i^T \right)^{-1} \left( \frac{1}{n} \sum_{i=1}^n \varrho_i^2 X_i X_i^T \right) \left( \frac{1}{n} \sum_{i=1}^n X_i X_i^T \right)^{-1}\n- **Standard Error Estimators**:\n - **HC0 (Huber-White)**: Uses squared OLS residuals \hat{\varrho}i^2 = \hat{\varpi}_i^2\n - **HC3 (Leave-One-Out)**: Uses jackknife / leave-one-out residuals \tilde{\varpi}_i^2 to prevent finite-sample bias (`sandwich::vcovHC(..., type = "HC3")`).\n\n# Encouragement Designs and Noncompliance (Instrumental Variables)\n\n- **Framework and Definitions**:\n - Binary encouraged assignment Z_i \in {0, 1} (randomized).\n - Binary treatment receipt D_i \in {0, 1}((D_i = 1ifparticipating,if participating,0 otherwise).\n - Potential treatment receipts: D_i(1)ififZ_i=1,,D_i(0)ififZ_i=0.Realizedreceipt:. Realized receipt:D_i = Z_i D_i(1) + (1-Z_i) D_i(0).\n - Potential outcomes: Y_i(1)ifencouraged,if encouraged,Y_i(0)ifnotencouraged.Realizedoutcome:if not encouraged. Realized outcome:Y_i = Z_i Y_i(1) + (1-Z_i) Y_i(0).\n- **Intent-to-Treat (ITT) Effects**:\n - Encouragement impact on compliance: \omega_D = E[D(1) - D(0)] = E[D|Z=1] - E[D|Z=0]\n - Encouragement impact on outcome (\text{ITT}_Y):):\omega_Y = E[Y(1) - Y(0)] = E[Y|Z=1] - E[Y|Z=0]\n\n# The Four Principal Strata and Structural Assumptions\n\n- **Principal Strata Categorization (U_i)**:\n 1. **Always-takers (a)∗∗:)**:D_i(1) = 1, D_i(0) = 1\n 2. **Compliers (c)∗∗:)**:D_i(1) = 1, D_i(0) = 0\n 3. **Defiers (d)∗∗:)**:D_i(1) = 0, D_i(0) = 1\n 4. **Never-takers (n)∗∗:)**:D_i(1) = 0, D_i(0) = 0\n- **Structural Assumptions**:\n 1. **Monotonicity (M)**: No defiers exist in the population (P(U_i = d) = 0).\n 2. **Exclusion Restriction (ER)**: Encouragement Zhasnodirecteffectonoutcomehas no direct effect on outcomeYforalways−takersandnever−takers(for always-takers and never-takers (Y_i(1) = Y_i(0)forforU_i \in {a, n}).\n\n# Local Average Treatment Effect (LATE) and the Wald Estimator\n\n- **Identification Theorem (Ding, Theorem 21.1)**:\n - Under Randomization (Z \perp!!!\perp {D(1), D(0), Y(1), Y(0)}),Monotonicity(), Monotonicity (M),andExclusionRestriction(), and Exclusion Restriction (ER):\n    \frac{\omega_Y}{\omega_D} = E[Y(1) - Y(0) \mid U = c]\n - The ratio \frac{\omega_Y}{\omega_D} equals the Local Average Treatment Effect (LATE), also known as the Complier Average Causal Effect (CACE).\n- **Mathematical Proof**:\n  \omega_Y = E[Y(1) - Y(0) | U=a] P(U=a) + E[Y(1) - Y(0) | U=c] P(U=c) + E[Y(1) - Y(0) | U=n] P(U=n)\n - Applying ER (Y(1) - Y(0) = 0forfora, n)andM() and M (P(U=d) = 0):\n    \omega_Y = E[Y(1) - Y(0) \mid U=c] P(U=c)\n - Evaluating \omega_D:\n    \omega_D = (1-1) P(U=a) + (1-0) P(U=c) + (0-0) P(U=n) = P(U=c)\n - Dividing \frac{\omega_Y}{\omega_D}yieldsyieldsE[Y(1) - Y(0) \mid U=c].\n- **Wald Estimator**:\n  \hat{\omega}_c = \frac{\hat{\omega}_Y}{\hat{\omega}_D} = \frac{\bar{Y}_1 - \bar{Y}_0}{\bar{D}_1 -   \bar{D}_0}\n- **Nonparametric Bootstrap Recipe for CACE Confidence Intervals**:\n - Draw nobservationsfromobservations from{(Y_i, Z_i, D_i)}{i=1}^nwithreplacementwith replacementB times.\n - Calculate \hat{\omega}c^{(b)}foreachbootstrapsamplefor each bootstrap sampleb = 1, \dots, B\n - Estimate \hat{V}{\hat{\omega}c}astheempiricalvarianceofas the empirical variance of{\hat{\omega}_c^{(b)}}{b=1}^B.\n - Construct 95\%confidenceinterval:confidence interval:\hat{\omega}c \pm 1.96 \sqrt{\hat{V}{\hat{\omega}c}}.\n- **Real-World Examples**:\n - **Moving to Opportunity (MTO)**: Z =housingvoucher/counselingoffer,housing voucher/counseling offer,D =movingtoalower−povertyneighborhood,moving to a lower-poverty neighborhood,Y = long-term health/education outcomes.\n - **Chicago Gun Violence Prevention Program (Bhatt et al., 2024)**: Z =randomofferofan18−monthjobandsupport(random offer of an 18-month job and support (2456high−riskmen),high-risk men),D =programparticipation(program participation (55\%compliancerate),compliance rate),Y = subsequent gun-related crime commission.\n\n# Instrumental Variables as a Regression Estimator\n\n- **Linear Regression Model with Endogeneity**:\n  Y = \boldsymbol{\omega}^T D + \varepsilon\n - Endogenous regressor: E[D \varepsilon] \neq 0.StandardOLSisinconsistent:. Standard OLS is inconsistent:\hat{\boldsymbol{\omega}}{OLS} \xrightarrow{p} \boldsymbol{\omega} + E[D D^T]^{-1} E[D \varepsilon] \neq \boldsymbol{\omega}.\n- **IV Estimator Derivation**:\n - Instrument vector Zsatisfiessatisfies\text{cov}(Z, \varepsilon) = E[Z \varepsilon] = 0\n - Expectation: E[Z(Y - D^T \boldsymbol{\omega})] = 0 \implies E[Z Y] = E[Z D^T] \boldsymbol{\omega}\n - Population IV parameter: \boldsymbol{\omega} = E[Z D^T]^{-1} E[Z Y]\n - Sample IV Estimator:\n    \hat{\boldsymbol{\omega}}{IV} = \left( \sum{i=1}^n Z_i D_i^T \right)^{-1} \left( \sum_{i=1}^n Z_i Y_i \right)\n- **Single Regressor with Intercept Case**:\n - Model: Y = \vartheta + \omega D + \varepsilonwithwithE[\varepsilon] = 0andand\text{cov}(Z, \varepsilon) = 0\n - Parameter: \omega = \frac{\text{cov}(Z, Y)}{\text{cov}(Z, D)}\n - Sample IV Estimator:\n    \hat{\omega}¨C93C{i=1}^n (Z_i - \bar{Z})(Y_i - \bar{Y})}{\sum_{i=1}^n (Z_i - \bar{Z})(D_i - \bar{D})}\n- **Proof of Equivalence to Wald Estimator for Binary Instrument Z \in {0, 1}**:\n - For binary Zwithwithp = P(Z=1):\n    \text{cov}(Z, Y) = p(1-p) \left( E[Y|Z=1] - E[Y|Z=0] \right)\n    \text{cov}(Z, D) = p(1-p) \left( E[D|Z=1] - E[D|Z=0] \right)\n - Ratio: \frac{\text{cov}(Z, Y)}{\text{cov}(Z, D)} = \frac{E[Y|Z=1] - E[Y|Z=0]}{E[D|Z=1] - E[D|Z=0]}, proving mathematical identity between linear IV and Wald CACE.\n- **Classic Observational Examples**:\n - **Draft Lottery**: Draft lottery number Zusedasaninstrumentformilitaryserviceused as an instrument for military serviceDtoestimateeffectonearningsto estimate effect on earningsY (Hearst et al. 1986; Angrist 1990).\n - **College Proximity**: Geographic distance to college Zusedasaninstrumentforeducationalattainmentused as an instrument for educational attainmentDtoestimateeffectonearningsto estimate effect on earningsY (Card 1993).\n\n# Two-Stage Least Squares (2SLS) and Properties of IV\n\n- **Adding Exogenous Regressors X**:\n - System equations:\n    Y_i = \omega_0 + \omega_1 D_i + \boldsymbol{\omega}¨C94C{1i}\n    D_i = \varpi_0 + \varpi_1 Z_i + \boldsymbol{\varpi}¨C95C{2i}\n - Let \tilde{Z}¨C96C{IV} = \left( \sum_{i=1}^n \tilde{Z}¨C97C{i=1}^n \tilde{Z}¨C98C{IV} \mid X, Z, D) = \frac{1}{n} A^{-1} B (A^{-1})^T\n    A = \frac{1}{n} \sum_{i=1}^n \tilde{Z}¨C99C{i=1}^n V(\varpi_i \mid Z_i, X_i) \tilde{Z}¨C100C{\omega \to 0^+} E[Y \mid Z = 1, X = x_0 + \omega] - \lim_{\omega \to 0^+} E[Y \mid Z = 0, X = x_0 - \omega]\n\n# Local Estimation, Bandwidth Selection, and Kernel Weighting in RD\n\n- **Local Regression Estimation**:\n - Restrict sample to observations within bandwidth h > 0,i.e.,, i.e.,|X_i - x_0| \le h\n - Fit local linear regression left (X_i < x_0)andright() and right (X_i \ge x_0) of cutoff:\n    \hat{Y} = \hat{\vartheta}_0 + \hat{\vartheta}_1 (X_i - x_0) + \hat{\vartheta}_2 Z_i + \hat{\vartheta}_3 Z_i (X_i - x_0)\n - The treatment effect estimate \hat{\omega}(x_0) equals the difference in estimated intercepts at the cutoff:\n    \hat{\omega}(x_0) = \hat{\vartheta}_2\n- **Senate Empirical Application Results (Cattaneo et al. 2015 Data)**:\n - OLS local linear regression with arbitrary bandwidth h = 20\n - Estimate \hat{\vartheta}_2 = 7.03\n - HC0 95\%ConfidenceInterval:Confidence Interval:[4.52, 9.54];HC3; HC395\%ConfidenceInterval:Confidence Interval:[4.50, 9.56].\n- **Bandwidth Choice Trade-Off**:\n - *Small bandwidth h∗:Highvariance(fewlocalobservations),lowbias(closerto*: High variance (few local observations), low bias (closer tox_0\n - *Large bandwidth h∗:Lowvariance(manyobservations),highbias(involvesobservationsfarfrom*: Low variance (many observations), high bias (involves observations far fromx_0\n - *Optimal bandwidth*: Minimizes Mean Squared Error (MSE), implemented via `mserd` in `rdrobust`.\n- **Kernel Weighting Functions (u = \frac{X_i - x_0}{h})**:\n - **Uniform Kernel**: K(u) = \mathbf{1}(|u| \le 1)\n - **Triangular Kernel** (Default in `rdrobust`): K(u) = (1 - |u|) \mathbf{1}(|u| \le 1)\n - **Epanechnikov Kernel**: K(u) = (1 - u^2) \mathbf{1}(|u| \le 1)\n- **`rdrobust` Package Inference Results (Senate Data, Default Settings)**:\n - Optimal bandwidth choice h = 17.754,biasbandwidth, bias bandwidthb = 28.028,,\rho = h/b = 0.633\n - Number of effective observations: 360leftofcutoff,left of cutoff,323 right of cutoff.\n - **Conventional Estimate**: Point Estimate = 7.41,,95\%CI=CI =[4.56, 10.27]\n - **Bias-Corrected Estimate**: Point Estimate = 7.51,,95\%CI=CI =[4.65, 10.37]\n - **Robust Inference Estimate**: Point Estimate = 7.51,,z = 4.311,,p = 0.000,,95\%CI=CI =[4.09, 10.92]$$.