Causal Inference What If Chapters 21-25 (因果推断第 21-25 章)¶
来源: Causal Inference: What If (Hernán & Robins)
编译时间: 2026-06-01
状态: 中英对照编译
基于: 第 21-25 章核心概念
关联: 因果推断第 16-20 章
📚 目录 (Table of Contents)¶
21. 第 21 章 工具变量进阶 (Chapter 21 Instrumental Variables Advanced)¶
21.1 局部平均处理效应再探 (LATE Revisited)¶
英文:
The Local Average Treatment Effect (LATE) is the average causal effect among compliers - individuals who take treatment if and only if encouraged by the instrument.
中文:
局部平均处理效应 (LATE) 是依从者中的平均因果效应 - 那些当且仅当被工具鼓励时才接受处理的个体。
LATE 识别假设 (LATE Identification Assumptions):
| 假设 | 英文 | 数学表达 |
|---|---|---|
| 相关性 | Relevance | Cov(Z, A) ≠ 0 |
| 独立性 | Independence | Z ⊥⊥ (Y^a, A^z) |
| 排除限制 | Exclusion Restriction | Y^{z,a} = Y^{z',a} |
| 单调性 | Monotonicity | A_i(1) ≥ A_i(0) ∀i |
LATE 公式 (LATE Formula):
其中: - \(ITT_Y\): 工具对结局的意向治疗效应 - \(ITT_A\): 工具对处理的意向治疗效应
21.2 多值工具变量 (Multi-Valued Instruments)¶
英文:
When the instrument takes more than two values, we can identify multiple local causal effects.
中文:
当工具取多个值时,我们可以识别多个局部因果效应。
多值 IV 模型 (Multi-Valued IV Model):
Wald 估计量推广 (Generalized Wald Estimator):
21.3 弱工具变量问题 (Weak Instrument Problem)¶
英文:
A weak instrument is one that is only weakly correlated with the treatment, leading to biased IV estimates and invalid inference.
中文:
弱工具变量是与处理只有弱相关的工具,导致有偏的 IV 估计和无效的推断。
弱工具诊断 (Weak Instrument Diagnostics):
| 统计量 | 阈值 | 说明 |
|---|---|---|
| F 统计量 | F > 10 | 第一阶段 F 检验 |
| Cragg-Donald | CD > 临界值 | 多工具情况 |
| Anderson-Rubin | AR 检验 | 弱工具稳健 |
22. 第 22 章 断点回归设计进阶 (Chapter 22 Regression Discontinuity Advanced)¶
22.1 模糊断点回归 (Fuzzy RD)¶
英文:
In fuzzy RD, the probability of treatment receipt jumps at the cutoff but not from 0 to 1. Fuzzy RD is analyzed using instrumental variables methods.
中文:
在模糊断点回归中,处理接受概率在断点处跳跃但不是从 0 到 1。模糊断点回归使用工具变量方法分析。
模糊 RD 估计量 (Fuzzy RD Estimator):
这本质上是 IV 估计,其中工具 \(Z = I(X \geq c)\)。
22.2 断点回归的带宽选择 (Bandwidth Selection in RD)¶
英文:
Bandwidth selection in RD involves a bias-variance tradeoff: smaller bandwidths reduce bias but increase variance.
中文:
断点回归的带宽选择涉及偏差 - 方差权衡:较小的带宽减少偏差但增加方差。
带宽选择方法 (Bandwidth Selection Methods):
| 方法 | 英文 | 特点 |
|---|---|---|
| IK 方法 | Imbens-Kalyanaraman | 数据驱动,最优速率 |
| CV 方法 | Cross-Validation | 最小化预测误差 |
| 插件法 | Plug-in | 基于高阶导数估计 |
Python 实现 (Python Implementation):
import numpy as np
from sklearn.linear_model import LinearRegression
def fuzzy_rd(Y, A, X, cutoff, bandwidth):
"""
模糊断点回归估计
参数:
Y: 结局变量
A: 处理变量
X: 运行变量
cutoff: 断点
bandwidth: 带宽
返回:
tau: 处理效应估计
"""
# 选择断点附近的样本
mask = np.abs(X - cutoff) < bandwidth
# 工具变量:是否在断点右侧
Z = (X >= cutoff).astype(int)
# 第一阶段:A ~ Z
first_stage = LinearRegression()
first_stage.fit(Z[mask].reshape(-1, 1), A[mask])
pi_hat = first_stage.coef_[0] # 第一阶段效应
# 简化式:Y ~ Z
reduced_form = LinearRegression()
reduced_form.fit(Z[mask].reshape(-1, 1), Y[mask])
itt_hat = reduced_form.coef_[0] # ITT 效应
# Wald 估计量
tau = itt_hat / pi_hat
return tau
23. 第 23 章 差分中的差分进阶 (Chapter 23 Difference-in-Differences Advanced)¶
23.1 平行趋势假设检验 (Parallel Trends Testing)¶
英文:
The parallel trends assumption states that, in the absence of treatment, the treatment and control groups would have followed similar trends.
中文:
平行趋势假设指出,在没有处理的情况下,处理组和对照组会遵循相似的趋势。
平行趋势检验 (Parallel Trends Test):
如果 \(\delta_k\) 在治疗前不显著,则支持平行趋势假设。
23.2 多期 DID 与交错采用 (Multi-Period DID with Staggered Adoption)¶
英文:
When units adopt treatment at different times, standard two-way fixed effects estimators can be biased.
中文:
当单元在不同时间采用处理时,标准的双向固定效应估计量可能有偏。
TWFE 模型 (Two-Way Fixed Effects):
其中: - \(\alpha_i\): 个体固定效应 - \(\lambda_t\): 时间固定效应 - \(D_{it}\): 处理指示变量
估计问题 (Estimation Problems):
| 问题 | 说明 | 解决方案 |
|---|---|---|
| 负权重 | 处理效应异质性导致负权重 | Callaway-Sant'Anna 估计量 |
| 动态效应污染 | 前期处理效应污染后期估计 | Sun-Abraham 估计量 |
| 序列相关 | 误差项序列相关 | 聚类标准误 |
23.3 合成控制法 (Synthetic Control Method)¶
英文:
The synthetic control method constructs a weighted combination of control units to approximate the treated unit's pre-treatment trajectory.
中文:
合成控制法构建控制单元的加权组合来近似处理单元的治疗前轨迹。
合成控制优化 (Synthetic Control Optimization):
其中: - \(X_1\): 处理单元的特征 - \(X_0\): 控制单元的特征矩阵 - \(w\): 权重向量
24. 第 24 章 因果中介分析 (Chapter 24 Causal Mediation Analysis)¶
24.1 自然直接效应与自然间接效应 (Natural Direct and Indirect Effects)¶
英文:
Natural direct and indirect effects decompose the total effect into pathways through the mediator and pathways not through the mediator.
中文:
自然直接效应和自然间接效应将总效应分解为通过中介的路径和不通过中介的路径。
效应分解 (Effect Decomposition):
其中: - NDE (自然直接效应): \(E[Y^{a, M^{a^*}} - Y^{a^*, M^{a^*}}]\) - NIE (自然间接效应): \(E[Y^{a^*, M^a} - Y^{a^*, M^{a^*}}]\)
24.2 中介分析的识别假设 (Identification Assumptions for Mediation)¶
英文:
Mediation analysis requires stronger assumptions than standard causal inference, including no unmeasured confounding of the mediator-outcome relationship.
中文:
中介分析比标准因果推断需要更强的假设,包括中介 - 结局关系无未测量混杂。
中介分析假设 (Mediation Assumptions):
| 假设 | 英文 | 说明 |
|---|---|---|
| 无 A-Y 混杂 | No A-Y confounding | \(Y^a \perp A\) |
| 无 M-Y 混杂 | No M-Y confounding | \(Y^{a,m} \perp M\) |
| 无 A-M 混杂 | No A-M confounding | \(M^a \perp A\) |
| 无 M-Y 暴露诱导混杂 | No M-Y exposure-induced confounding | 无 A 影响的 M-Y 混杂 |
24.3 中介分析的实现 (Implementation of Mediation Analysis)¶
英文:
Mediation effects can be estimated using regression-based approaches or inverse probability weighting.
中文:
中介效应可以使用基于回归的方法或逆概率加权来估计。
回归方法 (Regression Approach):
from sklearn.linear_model import LinearRegression
import numpy as np
def mediation_analysis(A, M, Y):
"""
中介分析 - 回归方法
参数:
A: 处理变量
M: 中介变量
Y: 结局变量
返回:
total_effect, direct_effect, indirect_effect
"""
# 模型 1: M ~ A
model_M = LinearRegression()
model_M.fit(A.reshape(-1, 1), M)
alpha = model_M.coef_[0]
# 模型 2: Y ~ A + M
model_Y = LinearRegression()
model_Y.fit(np.column_stack([A, M]), Y)
beta_prime = model_Y.coef_[0] # 直接效应
beta = model_Y.coef_[1] # M 对 Y 的效应
# 效应分解
direct_effect = beta_prime
indirect_effect = alpha * beta
total_effect = direct_effect + indirect_effect
return total_effect, direct_effect, indirect_effect
25. 第 25 章 因果推断的未来方向 (Chapter 25 Future Directions)¶
25.1 机器学习与因果推断的融合 (Integration of ML and Causal Inference)¶
英文:
Machine learning methods are increasingly being integrated with causal inference to handle high-dimensional data and complex relationships.
中文:
机器学习方法正越来越多地与因果推断融合,以处理高维数据和复杂关系。
前沿方向 (Frontier Directions):
| 方向 | 英文 | 中文 | 应用 |
|---|---|---|---|
| Causal ML | Causal Machine Learning | 因果机器学习 | 异质性处理效应 |
| Double/Debiased ML | 双/去偏机器学习 | 高维干扰控制 | 政策评估 |
| Meta-learners | 元学习器 | S/T/X-learner | 个性化医疗 |
| Causal Discovery | 因果发现 | 从数据学习因果图 | 探索性分析 |
25.2 因果强化学习 (Causal Reinforcement Learning)¶
英文:
Causal reinforcement learning combines causal inference with reinforcement learning to improve decision-making under uncertainty.
中文:
因果强化学习结合因果推断与强化学习,改进不确定性下的决策。
Causal RL 框架 (Causal RL Framework):
25.3 个人化因果推断 (Personalized Causal Inference)¶
英文:
Personalized causal inference aims to estimate individual-level treatment effects rather than population averages.
中文:
个人化因果推断旨在估计个体水平的处理效应,而非群体平均。
个体处理效应 (Individual Treatment Effect):
条件平均处理效应 (CATE):
25.4 因果推断的软件与可重复性 (Software and Reproducibility)¶
英文:
The development of user-friendly software packages has made causal inference methods more accessible and reproducible.
中文:
用户友好软件包的开发使因果推断方法更易获取和可重复。
主要软件包 (Key Software Packages):
| 软件 | 语言 | 功能 |
|---|---|---|
| EconML | Python | 异质性处理效应 |
| DoWhy | Python | 因果图 + 多种估计 |
| CausalImpact | R | 因果影响分析 |
| MatchIt | R | 匹配方法 |
| dagitty | Web/R | DAG 分析 |
🔑 关键术语对照表 (Glossary)¶
| English | 中文 | 定义 |
|---|---|---|
| LATE | 局部平均处理效应 | 依从者中的平均因果效应 |
| Compliers | 依从者 | 被工具鼓励才接受处理的个体 |
| Weak instrument | 弱工具变量 | 与处理弱相关的工具 |
| Fuzzy RD | 模糊断点回归 | 处理概率在断点跳跃但非 0-1 |
| Bandwidth | 带宽 | 断点附近用于分析的区间宽度 |
| Parallel trends | 平行趋势 | DID 的核心假设 |
| Staggered adoption | 交错采用 | 单元在不同时间采用处理 |
| Synthetic control | 合成控制 | 构建加权对照组的方法 |
| Natural direct effect | 自然直接效应 | 不通过中介的效应 |
| Natural indirect effect | 自然间接效应 | 通过中介的效应 |
| Mediation analysis | 中介分析 | 分解直接和间接效应 |
| Causal ML | 因果机器学习 | ML 与因果推断的融合 |
| CATE | 条件平均处理效应 | 给定协变量的处理效应 |
| ITE | 个体处理效应 | 个体水平的因果效应 |
编译完成时间: 2026-06-01
来源: Causal Inference: What If 第 21-25 章
关联文档: causal-inference-ch16-20-zh-en.md