identification-theory
安装方式
先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "identification-theory":https://skillpi.com/zh/skills/deepskill-9aed90dce4154af67fced34f2cf3d5e9a6aae1b17f2b8472d6005b7eddc98e7c。安装前核对上游来源和版本:https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills/blob/bfa0a6e5a843babbf45a1ef1663fd5dc4f07c0ba/skills/26-Data-Wise-scholar/skills/mathematical/identification-theory/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。
npx skills add https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills/tree/bfa0a6e5a843babbf45a1ef1663fd5dc4f07c0ba/skills/26-Data-Wise-scholar/skills/mathematical/identification-theory --skill identification-theory来源与配置
查看 GitHub 源码brycewang-stanford/Auto-Empirical-Research-Skills固定提交 bfa0a6e5a843babbf45a1ef1663fd5dc4f07c0ba
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
本条目面向文献与学术工具场景,提供“identification-theory”技能的目录入口。公开标签:learning、因果推断、中介分析、DAG。请通过固定上游版本核对实际功能、依赖与权限;此页为 Skillπ 独立编写的用途介绍和原站链接,不代表运行安全保证。原文与附件依各自许可开放。
文件浏览
---
name: identification-theory
description: DAG and potential outcomes frameworks for causal mediation identification
---
# Identification Theory
**Comprehensive framework for causal identification in statistical methodology**
Use this skill when working on: causal identification, mediation analysis identification, DAG-based reasoning, potential outcomes, identification assumptions, partial identification, sensitivity analysis, or deriving identification formulas.
---
## Core Concepts
### What is Identification?
A causal parameter $\psi$ is **identified** if it can be uniquely determined from the observed data distribution $P(O)$.
Formally: $\psi$ is identified if $P_1(O) = P_2(O) \Rightarrow \psi_1 = \psi_2$.
### Why Identification Matters
```
Causal Question → Target Estimand → Identification → Estimation → Inference
↓ ↓ ↓ ↓ ↓
"Does A E[Y(1)-Y(0)] Express in Statistical Confidence
cause Y?" terms of P(O) methods intervals
```
Without identification, no amount of data can answer causal questions.
---
## Two Frameworks
### 1. Potential Outcomes (Rubin/Neyman)
**Primitives**:
- $Y(a)$ = potential outcome under treatment $a$
- Only $Y = Y(A)$ is observed (consistency)
- Fundamental problem: never observe both $Y(0)$ and $Y(1)$ for same unit
**Advantages**:
- Clear definition of causal effects
- Natural for experimental reasoning
- Connects to missing data theory
### 2. Structural Causal Models (Pearl)
**Primitives**:
- Directed Acyclic Graph (DAG) encoding causal structure
- Structural equations: $Y := f_Y(PA_Y, U_Y)$
- Interventions via do-operator: $P(Y | do(A=a))$
**Advantages**:
- Visual representation of assumptions
- Systematic identification algorithms
- Clear separation of statistical and causal assumptions
---
## DAG Framework
### Directed Acyclic Graphs (DAGs)
A DAG $\mathcal{G} = (V, E)$ consists of:
- **Vertices** $V$: Random variables
- **Directed edges** $E$: Direct causal relationships
- **Acyclic**: No directed cycles
### Key DAG Terminology
| Term | Definition | Notation |
|------|------------|----------|
| Parents | Direct causes | $PA_Y$ |
| Children | Direct effects | $CH_Y$ |
| Ancestors | All causes | $AN_Y$ |
| Descendants | All effects | $DE_Y$ |
| Collider | Node with two incoming arrows | $A \to C \leftarrow B$ |
| Mediator | Node on causal path | $A \to M \to Y$ |
| Confounder | Common cause | $A \leftarrow C \to Y$ |
```r
# DAG specification and visualization using dagitty
library(dagitty)
# Define mediation DAG
mediation_dag <- dagitty('
dag {
A [exposure]
M [mediator]
Y [outcome]
X [confounder]
X -> A
X -> M
X -> Y
A -> M
A -> Y
M -> Y
}
')
# Visualize
plot(mediation_dag)
# Find adjustment sets
adjustmentSets(mediation_dag, exposure = "A", outcome = "Y")
# Check implied conditional independencies
impliedConditionalIndependencies(mediation_dag)
```
---
## D-Separation
### The Core Concept
Two nodes $A$ and $B$ are **d-separated** by set $Z$ if every path between them is blocked.
### Path Blocking Rules
| Path Type | Blocked by conditioning on... |
|-----------|-------------------------------|
| Chain: $A \to M \to B$ | $M$ (blocks) |
| Fork: $A \leftarrow C \to B$ | $C$ (blocks) |
| Collider: $A \to C \leftarrow B$ | NOT $C$ (conditioning opens!) |
### D-separation Formula
$$A \perp\!\!\!\perp_{\mathcal{G}} B \mid Z \iff \text{every path } A \text{---} B \text{ is blocked by } Z$$
```r
# Check d-separation using dagitty
check_dseparation <- function(dag, x, y, z = NULL) {
if (is.null(z)) {
dseparated(dag, x, y)
} else {
dseparated(dag, x, y, z)
}
}
# Find all d-separating sets
find_dsep_sets <- function(dag, x, y) {
# All adjustment sets that d-separate x and y
adjustmentSets(dag, exposure = x, outcome = y, effect = "total")
}
# Verify conditional independence implications
verify_ci_implications <- function(dag, data) {
implied_ci <- impliedConditionalIndependencies(dag)
results <- lapply(implied_ci, function(ci) {
# Parse the CI statement
vars <- strsplit(as.character(ci), " _\\|\\|_ | \\| ")[[1]]
x <- vars[1]
y <- vars[2]
z <- if (length(vars) > 2) vars[3:length(vars)] else NULL
# Test with partial correlation or conditional independence test
test_result <- test_conditional_independence(data, x, y, z)
list(statement = as.character(ci), p_value = test_result$p.value)
})
do.call(rbind, lapply(results, as.data.frame))
}
```
---
## Backdoor Criterion
### Definition
A set $Z$ satisfies the **backdoor criterion** relative to $(A, Y)$ if:
1. No node in $Z$ is a descendant of $A$
2. $Z$ blocks every path between $A$ and $Y$ that contains an arrow into $A$
### Backdoor Adjustment Formula
If $Z$ satisfies the backdoor criterion:
$$P(Y | do(A = a)) = \sum_z P(Y | A = a, Z = z) P(Z = z)$$
or equivalently:
$$E[Y(a)] = E_Z[E[Y | A = a, Z]]$$
### Front-Door Criterion
When backdoor fails but mediator is unconfounded:
$$P(Y | do(A)) = \sum_m P(M = m | A) \sum_{a'} P(Y | M = m, A = a') P(A = a')$$
```r
# Check backdoor criterion
check_backdoor <- function(dag, exposure, outcome, adjustment_set) {
# Using dagitty
valid_sets <- adjustmentSets(dag, exposure = exposure,
outcome = outcome, type = "minimal")
# Check if proposed set is valid
is_valid <- any(sapply(valid_sets, function(s) {
setequal(s, adjustment_set)
}))
list(
is_valid = is_valid,
minimal_sets = valid_sets,
proposed = adjustment_set
)
}
# Compute backdoor-adjusted estimate
backdoor_adjustment <- function(data, outcome, exposure, adjustment) {
formula_str <- paste(outcome, "~", exposure, "+",
paste(adjustment, collapse = " + "))
model <- lm(as.formula(formula_str), data = data)
# Standardization
predictions_a1 <- predict(model,
newdata = transform(data, setNames(list(1), exposure)))
predictions_a0 <- predict(model,
newdata = transform(data, setNames(list(0), exposure)))
list(
ate = mean(predictions_a1 - predictions_a0),
se = sqrt(var(predictions_a1 - predictions_a0) / nrow(data))
)
}
# Full identification analysis
analyze_identification <- function(dag, exposure, outcome) {
list(
adjustment_sets = adjustmentSets(dag, exposure, outcome),
instrumental_sets = instrumentalVariables(dag, exposure, outcome),
direct_effects = adjustmentSets(dag, exposure, outcome, effect = "direct"),
implied_independencies = impliedConditionalIndependencies(dag)
)
}
```
### Framework Equivalence
For most problems, both frameworks give equivalent results:
$$E[Y(a)] = E[Y | do(A=a)]$$
Choose based on context and audience.
---
## Key Identification Assumptions
### For Treatment Effects
| Assumption | Formal Statement | Interpretation |
|------------|------------------|----------------|
| **Consistency** | $Y = Y(A)$ | Observed outcome equals potential outcome for received treatment |
| **Positivity** | $P(A=a \mid X=x) > 0$ for all $x$ with $P(X=x) > 0$ | Every covariate stratum has both treated and untreated |
| **Exchangeability** | $Y(a) \perp\!\!\!\perp A \mid X$ | No unmeasured confounding given $X$ |
| **SUTVA** | No interference, single version of treatment | Units don't affect each other |
### For Mediation Effects
Additional assumptions required:
| Assumption | Formal Statement | Interpretation |
|------------|------------------|----------------|
| **Cross-world exchangeability** | $Y(a,m) \perp\!\!\!\perp M(a^*) \mid X$ | Counterfactual mediator independent of counterfactual outcome |
| **No $A$-$M$ interaction** (optional) | $Y(a,m) - Y(a',m)$ constant in $m$ | Simplifies identification |
| **Compositional** | $Y(a) = Y(a, M(a))$ | Potential outcome composition |
---
## Standard Identification Results
### 1. Average Treatment Effect (ATE)
**Target**: $\psi = E[Y(1) - Y(0)]$
**Under exchangeability** (A1), **consistency** (A2), **positivity** (A3):
$$\psi = E\left[E[Y | A=1, X] - E[Y | A=0, X]\right]$$
**Proof sketch**:
\begin{align}
E[Y(a)] &= E[E[Y(a) | X]] && \text{(iterated expectations)} \\
&= E[E[Y(a) | A=a, X]] && \text{(A1: exchangeability)} \\
&= E[E[Y | A=a, X]] && \text{(A2: consistency)}
\end{align}
### 2. Average Treatment Effect on Treated (ATT)
**Target**: $\psi_{ATT} = E[Y(1) - Y(0) | A=1]$
**Under weaker exchangeability** $Y(0) \perp\!\!\!\perp A \mid X$:
$$\psi_{ATT} = E\left[E[Y | A=1, X] - E[Y | A=0, X] \mid A=1\right]$$
### 3. Natural Direct and Indirect Effects (Mediation)
**Target**:
- NDE: $E[Y(1, M(0)) - Y(0, M(0))]$
- NIE: $E[Y(1, M(1)) - Y(1, M(0))]$
**Under mediation assumptions** (see VanderWeele, 2015):
$$NDE = \int\int \{E[Y|A=1,M=m,X=x] - E[Y|A=0,M=m,X=x]\} \, dP(m|A=0,X=x) \, dP(x)$$
$$NIE = \int\int E[Y|A=1,M=m,X=x] \{dP(m|A=1,X=x) - dP(m|A=0,X=x)\} \, dP(x)$$
### 4. Controlled Direct Effect (CDE)
**Target**: $CDE(m) = E[Y(1,m) - Y(0,m)]$
**Simpler identification** (no cross-world assumption):
$$CDE(m) = E[E[Y|A=1,M=m,X] - E[Y|A=0,M=m,X]]$$
---
## DAG-Based Identification
### The Back-Door Criterion
A set $X$ satisfies the back-door criterion relative to $(A, Y)$ if:
1. No node in $X$ is a descendant of $A$
2. $X$ blocks every path between $A$ and $Y$ that contains an arrow into $A$
**If satisfied**:
$$P(Y | do(A=a)) = \sum_x P(Y | A=a, X=x) P(X=x)$$
### The Front-Door Criterion
When there's an unmeasured confounder $U$ between $A$ and $Y$, but $M$ mediates all of $A$'s effect:
```
U
/ \
↓ ↓
A → M → Y
```
**Identification**:
$$P(Y | do(A=a)) = \sum_m P(M=m | A=a) \sum_{a'} P(Y | M=m, A=a') P(A=a')$$
### Instrumental Variables
When $Z$ affects $Y$ only through $A$:
```
U
↓
Z → A → Y
```
**Local ATE identification** (with monotonicity):
$$LATE = \frac{E[Y | Z=1] - E[Y | Z=0]}{E[A | Z=1] - E[A | Z=0]}$$
---
## Sequential Identification (Multiple Mediators)
### Sequential Mediation (A → M1 → M2 → Y)
**Product of three path** identification requires:
1. Standard confounding control for each arrow
2. No intermediate confounders affected by treatment
3. Sequential ignorability assumptions
**Path-specific effects**:
- Direct: $A \to Y$
- Through $M_1$ only: $A \to M_1 \to Y$
- Through $M_2$ only: $A \to M_2 \to Y$
- Through both: $A \to M_1 \to M_2 \to Y$
### Identification Formula (No Intermediate Confounding)
$$\text{Effect through } M_1 \to M_2 = \int E\left[\frac{\partial^3}{\partial a \partial m_1 \partial m_2} E[Y|A,M_1,M_2,X]\right]$$
Expressed as product of coefficients: $\hat{\alpha}_1 \cdot \hat{\beta}_1 \cdot \hat{\gamma}_2$
---
## Partial Identification
When point identification fails, we can still bound the parameter.
### Manski Bounds (No Assumptions)
For ATE with missing outcomes:
$$E[Y(1)] \in [E[Y \cdot A]/P(A=1) + y_{min}P(A=0), E[Y \cdot A]/P(A=1) + y_{max}P(A=0)]$$
### Sensitivity Analysis
When exchangeability is uncertain, parameterize violation:
**Unmeasured confounding parameter** $\Gamma$:
$$\frac{1}{\Gamma} \leq \frac{P(A=1|X,U=1)/P(A=0|X,U=1)}{P(A=1|X,U=0)/P(A=0|X,U=0)} \leq \Gamma$$
Compute bounds as function of $\Gamma$ (Rosenbaum bounds).
### E-Value
Minimum strength of unmeasured confounding (on risk ratio scale) needed to explain away observed effect:
$$E\text{-value} = RR + \sqrt{RR \times (RR-1)}$$
---
## Identification Strategies by Design
### Randomized Controlled Trials (RCTs)
- Treatment assignment random → exchangeability holds by design
- Still need SUTVA, consistency
- For mediation: randomize $M$ as well, or use sequential ignorability
### Observational Studies
| Strategy | Key Assumption | Best For |
|----------|----------------|----------|
| Regression adjustment | All confounders measured | Rich covariate data |
| Propensity score | Correct PS model | High-dimensional confounders |
| Instrumental variables | Valid instrument exists | Unmeasured confounding |
| Regression discontinuity | Continuity at threshold | Sharp treatment rules |
| Difference-in-differences | Parallel trends | Panel data |
### Natural Experiments
- Exploit exogenous variation (policy changes, geographic variation)
- Requires careful argument for why variation is "as-if random"
---
## Identification in the MediationVerse
### medfit: Foundation
- Implements standard mediation identification
- VanderWeele regression-based approach
- Supports binary/continuous treatments and mediators
### probmed: Effect Size
- $P_M$ identification requires identified NDE/NIE
- Handles case when NDE and NIE have opposite signs
### RMediation: Confidence Intervals
- Takes identified effects as input
- Distribution of product of coefficients (PRODCLIN)
- Monte Carlo intervals
### medrobust: Sensitivity
- When identification assumptions are uncertain
- Bounds on effects under confounding
- E-values for unmeasured confounding
### medsim: Validation
- Simulate data where truth is known
- Verify identification formulas recover true effects
- Test estimator properties
---
## Identification Proof Template
```latex
\begin{theorem}[Identification of $\psi$]
Under Assumptions:
\begin{enumerate}[label=A\arabic*.]
\item (Consistency) $Y = Y(A)$, $M = M(A)$
\item (Positivity) $P(A=a|X) > \epsilon > 0$ for all $a \in \mathcal{A}$
\item (Exchangeability) $Y(a) \perp\!\!\!\perp A \mid X$
\end{enumerate}
the causal estimand $\psi = E[g(Y(a))]$ is identified by
\[
\psi = E_X\left[E[g(Y) \mid A=a, X]\right].
\]
\end{theorem}
\begin{proof}
\begin{align}
E[g(Y(a))] &= E\left[E[g(Y(a)) \mid X]\right]
&& \text{(law of total expectation)} \\
&= E\left[E[g(Y(a)) \mid A=a, X]\right]
&& \text{(by A3: exchangeability)} \\
&= E\left[E[g(Y) \mid A=a, X]\right]
&& \text{(by A1: consistency)}
\end{align}
The RHS depends only on the observed data distribution $P(Y,A,X)$.
\end{proof}
```
---
## Common Identification Pitfalls
### 1. Conditioning on Colliders
```
A → C ← Y
```
Conditioning on $C$ opens a path between $A$ and $Y$.
### 2. Conditioning on Mediators
```
A → M → Y
```
Conditioning on $M$ blocks the indirect effect, doesn't control confounding.
### 3. Overcontrol Bias
Conditioning on descendants of treatment can bias estimates.
### 4. M-Bias
```
U1 → X ← U2
↓ ↓
A ——————→ Y
```
Conditioning on $X$ opens path $A \leftarrow U_1 \rightarrow X \leftarrow U_2 \rightarrow Y$.
### 5. Table 2 Fallacy
Interpreting coefficients causally when model includes intermediate variables.
---
## Verification Questions
When reviewing identification arguments, ask:
1. **Is the target estimand clearly defined?**
2. **Are all assumptions explicitly stated?**
3. **Is each step in the derivation justified?**
4. **Are the assumptions plausible in this context?**
5. **What if an assumption is violated?**
6. **Is there a DAG that encodes the assumptions?**
7. **Are there alternative identification strategies?**
---
## Integration with Other Skills
This skill works with:
- **proof-architect** - For writing identification proofs
- **asymptotic-theory** - For inference after identification
- **methods-paper-writer** - For presenting identification in manuscripts
- **simulation-architect** - For validating identification
---
## Key References
- Imai
- Hernan
- Pearl, J. (2009). Causality: Models, Reasoning, and Inference (2nd ed.)
- VanderWeele, T.J. (2015). Explanation in Causal Inference
- Hernán, M.A. & Robins, J.M. (2020). Causal Inference: What If
- Imbens, G.W. & Rubin, D.B. (2015). Causal Inference for Statistics
---
**Version**: 1.0
**Created**: 2025-12-08
**Domain**: Causal Inference, Mediation Analysis
版本历史
-
v2026.07
GitHub ↗
原版更新说明
## Highlights - **First tagged release.** Every gate is green: `make check` (validate + 183 unit tests + eval-harness + numeric benchmarks), validate-catalog, quality-evals, and OpenSSF Scorecard on `main`. - **Rigor double loop at 13 method families.** Each family closes taxonomy tag → eval scenario (does the agent avoid the method's known traps?) → deterministic numeric benchmark (does it recover the true effect?). New this cycle: heterogeneous treatment effects (CATE) and quantile treatment effects (QTE). - **Paper-WorkFlow flagship at 29/29 executable rigor gates**, now merged to its `main` with a drift-gated README badge — the credibility artifact is checked by CI, so it can never silently go stale ([RIGOR.md](https://github.com/brycewang-stanford/Paper-WorkFlow/blob/main/RIGOR.md)). - **1,150 vendored skills / 69 collections**, all license-audited, security-scanned, tracked in a machine-readable catalog with CI-enforced freshness, and importable as a single whole-repo router skill. - **Hardened weekly upstream syncs**: synced trees must pass the full gate before merge; this cycle both sync PRs were verified, patched (StatsPAI's SkillOpt execution-gate card restored), and merged. - **First-party plugin marketplace** (Python / R / Stata empirical-analysis plugins + guide) shipped in the previous cycle, now under a tagged version. ## Known Follow-Ups - Ecosystem benchmark comparison (AERS vs econometrics agents on the shared benchmark suite) — [PLAN-2026-07 week 3](https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills/blob/main/docs/PLAN-2026-07.md). - Decomposition (Oaxaca–Blinder) and shift-share (Bartik) method families (weeks 3–4). - GitHub Pages catalog site, README demo screenshots, five-language README consistency script (week 4). ## Catalog - Top-level collections: **69** - `SKILL.md` files: **1150** - Cataloged agent tools: **335** ([`tools/CATALOG.md`](../tools/CATALOG.md)) ## Methodological rigor - Method families in the coverage map: **13** ([`RIGOR_COVERAGE.md`](RIGOR_COVERAGE.md)) - Eval scenarios: **26** (138 rubric items, 122 auto-checkable) ([`../eval-harness/`](../eval-harness/README.md)) - Benchmark tasks: **13** (70 gold checks, 58 required) ([`../benchmark/`](../benchmark/README.md)) ### Method families (skills tagged) - `iv`: 27 - `rdd`: 25 - `panel-fe`: 19 - `staggered-did`: 17 - `bayesian`: 13 - `did`: 10 - `event-study`: 10 - `matching`: 10 - `synthetic-control`: 10 - `cate`: 8 - `dml`: 8 - `survival`: 3 - `quantile`: 2 ### Eval scenarios by category - `causal-identification`: 14 - `citation-hygiene`: 1 - `reproducibility`: 2 - `research-integrity`: 1 - `runtime-safety`: 1 - `statistical-validity`: 2 - `writing-compliance`: 3 - `writing-style`: 2 ## License buckets - AGPL-3.0: 1 - Apache-2.0: 1 - CC-BY-NC-4.0 (non-commercial): 1 - CC-BY-SA-4.0: 1 - CC-BY-SA-4.0 (repository default): 4 - GPL-3.0: 1 - MIT: 35 - MIT Non-Commercial: 1 - Mixed (per-skill; see folder): 2 - UNKNOWN - check upstream: 22 ## Quality gates - `make check` — catalog/provenance/audit/eval freshness, repo hygiene, Paper-WorkFlow gates, stdlib unit tests, eval-harness lint + graded smoke, and the strict numeric benchmark (reference-gold drift fails the build). - External links and OpenSSF Scorecard run on their scheduled workflows.
当前收录版本
0.0.1
质量评测
满分 100。前四项来自 DeepSkill 收录的质量报告。
评分依据
提供因果中介识别的完整理论框架,涵盖DAG和潜在结果两种主流方法
评分依据
触发词覆盖全面,包括'causal identification'、'mediation analysis'等核心术语
评分依据
文档结构清晰,分章节系统讲解核心概念
评分依据
工具来源明确(dagitty等标准因果推断包)
计算方式
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
risk · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。