M1-057M1: Mathematics & Statistics FundamentalsCausal InferenceEasy
⚡Flashcard Drill➔Mastery:
Explain Confounders, Mediators, and Colliders in Causal DAGs and Which Must or Must Not Be Controlled
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Confounders (forks ) cause spurious correlation and MUST be controlled; Mediators () transmit mechanisms and should NOT be controlled for total effect; Colliders () induce artificial association when controlled and MUST NOT be controlled.
📌 Key Takeaways
- •Confounder (): Common cause of both treatment and outcome ; creates non-causal backdoor paths that MUST be blocked/conditioned on.
- •Mediator (): Intermediate step along the causal pathway ; controlling for blocks the indirect causal effect, leaving only direct effect.
- •Collider (): Common effect of both treatment and outcome ; conditioning on a collider OPENS a spurious association path (Berkson's Paradox).
📐 Mathematical Derivations
DAG structural mechanics via d-separation: (1) Fork : and are dependent: . Conditioning on blocks the path: . Hence, adjusting for confounders isolates the true causal arc . (2) Chain : Conditioning on blocks the transmission: . Doing so eliminates the primary causal mechanism. (3) Collider : Unconditioned, and are marginally independent: . However, conditioning on induces correlation: . For example, let = Talent, = Hard Work, = College Admission (). Among admitted students (), knowing someone is not talented implies they must be exceptionally hardworking, inducing artificial negative correlation.
🏭 Production Trade-offs
In ML feature engineering and causal analytics: (1) Bad Controls: Data scientists often throw all available database columns into regression. Controlling for post-treatment variables (mediators or colliders) introduces catastrophic selection bias. (2) Backdoor Criterion: A set of variables is valid for adjustment if no node in is a descendant of , and blocks every backdoor path between and .
⚠️ Common Interview Pitfalls
- ✕Conditioning on a collider (e.g. Analyzing user churn only among active users who logged in post-treatment).
- ✕Controlling for a mediator when the business objective is to evaluate the total end-to-end effect.
🎯 Interviewer Follow-up Inquiries
- ?What is Pearl's Backdoor Criterion and how does it formally identify sufficient adjustment sets?
- ?What is M-bias in causal DAGs and how does conditioning on a pre-treatment variable inadvertently act as a collider?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚
Associated Knowledge Base Guides & Mindmaps
Explore the comprehensive technical article, exam cards, and global architecture tree.
中文速览与面试要点
解释混淆变量、中介变量与对撞变量,以及各自该不该控制。
混淆需控制(否则有偏);中介不应控制(会屏蔽效应);对撞控制会引入选择偏差。
核心要点
- 三类变量按 DAG 结构区分,控制策略完全相反:① 混淆变量(confounder) ——同时影响处理 T 与结果 Y(X→T, X→Y),产生 伪相关 。必须控制,否则把 X 的效应误归给 T。后门准则给出系统判据:控制所有'从 T 到 Y 的后门路径'上的变量。② 中介变量(mediator) ——位于因果链中间(T→M→Y),承载部分因果效应。 不应控制 :控制它会阻断该路径,得到的是'直接效应'而非'总效应',从而 低估 总效应。若研究目的就是分解直接/间接效应,则需专门的中介分析而非简单控制。③ 对撞变量(collider) ——同时被 T 与 Y 影响(T→C←Y)。 不应控制 :控制它会在 T 与 Y 之间 制造 虚假关联(对撞偏差 / collider bias / Berkson 悖论)。经典例子:录取 C 由天赋 X 与努力 Y 共同决定(X→C←Y),在录取者中控制 C 会得到'天赋与努力负相关'的虚假结论。
- 实践要点:① 先画 DAG 再决定控制什么 ——这是避免错误控制的最有效方法;仅凭'相关性'或'常识'选控制变量极易犯两类错误(漏控混淆、误控对撞)。② 中介分析的三种效应 ——总效应(不控制 M)、直接效应(控制 M)、间接效应(总−直接);近年因果推断强调 不要对中介做条件化 ,而应用 mediation analysis 或 path-specific effects。③ 对撞偏差的隐蔽性 ——它常在'看起来合理'的控制中发生,如按'是否住院'分层研究疾病(住院是疾病与就医行为的对撞)、按'是否点击'分层分析广告效果(点击是广告与用户兴趣的对撞)。④ M-bias 与工具变量 ——更复杂的情形是变量同时是混淆与对撞(M-bias),或存在未观测混淆时需用工具变量/断点回归等设计。
- 用 DAG 判断该控制什么(后门准则)
- 对撞偏差 = 条件化后制造出虚假相关(Berkson 悖论)
常见陷阱
- 为了'控制得更多'而误控对撞变量
- 控制中介后把直接效应当总效应报告