dowhy
Causal inference framework for answering "does X cause Y?" beyond correlation. DoWhy (Microsoft Research) provides the identify-estimate-refute loop: define a causal graph (DAG), identify the causal effect using backdoor/frontdoor/instrumental variable criteria, estimate treatment effects with multiple estimators, and validate results with automated refutation tests. Use when: distinguishing causation from correlation, estimating treatment effects (ATE, ATT, CATE), designing and analyzing A/B tests with confounders, using instrumental variables, performing counterfactual reasoning ("what would
npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill dowhy --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides the agent to analyze causal questions using a DAG-based framework. It identifies whether a causal effect is estimable from data given a graph, then estimates the effect with appropriate methods, and finally runs refutation tests to assess robustness.
How it works
- The agent must accept a dataset, treatment variable(s), outcome variable, and a graph string defining a DAG.
- It performs IDENTIFY to determine if the causal effect is estimable from the observational data, selecting a strategy such as backdoor, frontdoor, or instrumental variables.
- It performs ESTIMATE using an identified strategy, via methods like backdoor.linear_regression, backdoor.propensity_score_matching, backdoor.propensity_score_weighting, frontdoor.two_stage_linear_regression, or iv.instrumental_variable.
- It performs REFUTE using methods such as refute_placebo_treatment, refute_random_common_cause, refute_data_subset, among others.
- It may also provide concrete examples of graph construction (e.g., DAG syntax) and show how to run the standard causal process across code blocks (CausalModel usage, identify_effect, estimate_effect, refute_estimate).
When to use it
- When you want to distinguish causation from correlation in observational data.
- When estimating treatment effects: ATE, ATT, or CATE.
- When designing and analyzing A/B tests with potential confounders.
- When using instrumental variables or performing counterfactual reasoning.
What it can touch
- The skill uses a toolkit that includes code patterns for creating a CausalModel with data, treatment, outcome, and graph.
- It supports multiple estimation methods corresponding to causal identification strategies (e.g., backdoor, frontdoor, IV).
- It includes refutation methods to test robustness of the estimated causal effect.
Caveats
- The approach requires a DAG that encodes domain knowledge; identifiability depends on correct graph specification.
- Refutation results depend on the chosen methods and data; not all scenarios guarantee robust conclusions.
- No explicit outcomes are promised; outcomes are contingent on identifiability and model assumptions.
# DoWhy — Causal Inference DoWhy answers the question every analyst actually wants answered: **"Does X cause Y, or is it just correlated?"** Correlation is everywhere. Causation requires structure — a causal graph that encodes which variables influence which. DoWhy's workflow is three steps: **Identify** (is the effect estimable from this graph?) → **Estimate** (compute the effect) → **Refute** (is this estimate robust?). ## Core Mental Model ``` CORRELATION: X and Y move together. Could be: X → Y (X causes Y) Y → X (Y causes X) X ← C → Y (C confounds both — spurious!) CAUSATION: We need to know WHY they move together. A causal graph (DAG) encodes our assumptions. Then math tells us: "Given this graph, CAN we estimate the causal effect from data?" → If yes: which variables to control for? → If no: what additional data do we need? ``` ## When to Use - "Does this ad campaign actually increase sales, or do people who see ads already buy more?" - "Does smoking cause cancer?" (observational data, can't randomize) - "What would revenue have been if we hadn't changed the pricing?" (counterfactual) - Any analysis where confounders exist and you have a theory about the causal structure. **W
- Core Mental Model
- When to Use
- Reference Documentation
- Core Principles
- The Causal Graph (DAG)
- The Identify-Estimate-Refute Loop
- Confounders Are the Enemy
- Treatment Effect Types
- Quick Reference
- Installation
- Standard Imports
- Basic Pattern — Full Causal Pipeline
- Critical Rules
- ✅ DO
What does the dowhy skill do?
Causal inference framework for answering "does X cause Y?" beyond correlation. DoWhy (Microsoft Research) provides the identify-estimate-refute loop: define a causal graph (DAG), identify the causal effect using backdoor/frontdoor/instrumental variable criteria, estimate treatment effects with multiple estimators, and validate results with automated refutation tests. Use when: distinguishing causation from correlation, estimating treatment effects (ATE, ATT, CATE), designing and analyzing A/B tests with confounders, using instrumental variables, performing counterfactual reasoning ("what would
How do I install it?
Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill dowhy --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From brycewang-stanford/Auto-Empirical-Research-Skills, a repository with 3,244 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.