stat-causal-inference

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Causal Inference

因果推断

Framework

框架

IRON LAW: Correlation Is Not Causation — But Causation Is Estimable

Observational data cannot prove causation through correlation alone.
BUT with the right methodology (matching, IV, DID, RDD), we CAN
estimate causal effects from observational data — IF the assumptions
of each method are satisfied and explicitly tested.

The key question is always: "What would have happened WITHOUT the treatment?"
(the counterfactual)
IRON LAW: Correlation Is Not Causation — But Causation Is Estimable

Observational data cannot prove causation through correlation alone.
BUT with the right methodology (matching, IV, DID, RDD), we CAN
estimate causal effects from observational data — IF the assumptions
of each method are satisfied and explicitly tested.

The key question is always: "What would have happened WITHOUT the treatment?"
(the counterfactual)

The Fundamental Problem

核心问题

We observe:
Y_i(treated)
— what happened to the treated unit. We want to know:
Y_i(treated) - Y_i(untreated)
— the causal effect. We can never observe:
Y_i(untreated)
for the same unit at the same time.
All causal inference methods estimate the counterfactual — what would have happened without the treatment.
我们观测到:
Y_i(treated)
—— 接受处理的个体的结果。 我们想了解:
Y_i(treated) - Y_i(untreated)
—— 因果效应。 我们永远无法观测到:同一个体在同一时间未接受处理时的
Y_i(untreated)
所有因果推断方法都是在估计counterfactual(反事实)—— 即未接受处理时会发生什么。

Method Selection Guide

方法选择指南

MethodWhen to UseKey Assumption
RCTYou can randomizeRandom assignment eliminates confounders
Propensity Score Matching (PSM)Treatment is non-random but based on observablesNo unobserved confounders (selection on observables)
Instrumental Variables (IV)Unobserved confounders exist but you have an instrumentInstrument affects treatment but not outcome directly
Difference-in-Differences (DID)Policy/event creates natural treatment/control groupsParallel trends: groups would have trended similarly without treatment
Regression Discontinuity (RDD)Treatment assigned by a cutoffObservations just above/below cutoff are comparable
Synthetic ControlOne treated unit, multiple control units (aggregate data)Synthetic weighted combination matches pre-treatment trends
方法使用场景核心假设
RCT可进行随机分配随机分配可消除混淆变量
Propensity Score Matching (PSM)处理分配非随机但基于可观测变量不存在未观测到的混淆变量(基于可观测变量选择)
Instrumental Variables (IV)存在未观测到的混淆变量但拥有工具变量工具变量影响处理分配但不直接影响结果
Difference-in-Differences (DID)政策/事件自然形成处理组/对照组平行趋势:若无处理,两组趋势将保持一致
Regression Discontinuity (RDD)处理分配基于阈值阈值上下的观测对象具有可比性
Synthetic Control一个处理单元,多个对照单元(聚合数据)加权合成组合匹配处理前趋势

Analysis Steps

分析步骤

  1. Define the causal question: What is the treatment? What is the outcome?
  2. Identify threats to validity: What confounders could explain the association?
  3. Choose a method: Based on data structure and available identification strategy
  4. Check assumptions: Each method has testable and untestable assumptions
  5. Estimate the effect: Run the analysis
  6. Sensitivity analysis: How much would results change if assumptions are partially violated?
  1. 明确因果问题:处理是什么?结果是什么?
  2. 识别有效性威胁:哪些混淆变量可以解释关联关系?
  3. 选择方法:基于数据结构和可用的识别策略
  4. 验证假设:每种方法都有可检验和不可检验的假设
  5. 估计效应:运行分析
  6. 敏感性分析:若假设部分不成立,结果会有多大变化?

Output Format

输出格式

markdown
undefined
markdown
undefined

Causal Analysis: {Treatment} → {Outcome}

Causal Analysis: {Treatment} → {Outcome}

Causal Question

Causal Question

  • Treatment: {what intervention/event}
  • Outcome: {what we're measuring}
  • Counterfactual: {what would have happened without treatment}
  • Treatment: {what intervention/event}
  • Outcome: {what we're measuring}
  • Counterfactual: {what would have happened without treatment}

Identification Strategy

Identification Strategy

  • Method: {PSM / IV / DID / RDD / etc.}
  • Rationale: {why this method fits}
  • Key assumption: {stated explicitly}
  • Assumption test: {how we check, or acknowledge if untestable}
  • Method: {PSM / IV / DID / RDD / etc.}
  • Rationale: {why this method fits}
  • Key assumption: {stated explicitly}
  • Assumption test: {how we check, or acknowledge if untestable}

Results

Results

  • Estimated causal effect: {magnitude with CI}
  • Robustness checks: {alternative specifications}
  • Estimated causal effect: {magnitude with CI}
  • Robustness checks: {alternative specifications}

Limitations

Limitations

{What could still invalidate these results}
undefined
{What could still invalidate these results}
undefined

Gotchas

注意事项

  • "Controlling for X" doesn't guarantee causation: Adding control variables to a regression reduces SOME confounding but not unobserved confounders. If the treatment wasn't random, OLS with controls is not causal.
  • Parallel trends is untestable: For DID, we can check pre-treatment parallel trends but can't prove they would have continued. It's an assumption, not a fact.
  • Weak instruments invalidate IV: An instrument that barely affects the treatment produces biased estimates (often worse than OLS). Test instrument strength with the first-stage F-statistic (> 10).
  • External validity: Causal effects estimated in one context may not generalize. An effect estimated for users near a cutoff (RDD) may not apply to the full population.
  • Causal inference requires domain knowledge: Statistical methods alone can't determine what is a confounder, what is a mediator, or what is a collider. Draw the causal diagram (DAG) first.
  • “控制X变量”无法保证因果关系:在回归中添加控制变量可减少部分混淆,但无法消除未观测到的混淆变量。若处理分配非随机,带控制变量的OLS回归不具备因果性。
  • 平行趋势不可检验:对于DID,我们可以检验处理前的平行趋势,但无法证明趋势会持续下去。这是一个假设,而非事实。
  • 弱工具变量会使IV失效:对处理分配影响极小的工具变量会产生有偏估计(通常比OLS更差)。用第一阶段F统计量(> 10)检验工具变量的强度。
  • 外部有效性:在某一情境下估计的因果效应可能无法推广。在阈值附近的用户群体(RDD)中估计的效应可能不适用于全部人群。
  • 因果推断需要领域知识:仅靠统计方法无法确定什么是混淆变量、中介变量或碰撞变量。应先绘制因果图(DAG)。

References

参考资料

  • For directed acyclic graphs (DAGs), see
    references/causal-dags.md
  • For DID implementation in Python/R, see
    references/did-implementation.md
  • 关于有向无环图(DAGs),请查看
    references/causal-dags.md
  • 关于在Python/R中实现DID,请查看
    references/did-implementation.md