Agent skill

Stat Causal Inference

by asgard-ai-platform in asgard-ai-platform/skills

Apply causal inference methods — counterfactual framework, instrumental variables, propensity score matching, and difference-in-differences — to estimate causal effects from observational data.

MITAuto-check passedResearch & Science

Install Stat Causal Inference

skills CLI
$ npx skills add asgard-ai-platform/skills --skill stat-causal-inference -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install asgard-ai-platform/skills stat-causal-inference --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/asgard-ai-platform/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/stat-causal-inference .claude/skills/stat-causal-inference && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stat-causal-inference
GitHub stars
242
Token cost
~1.2k tokens
SKILL.md length
372 words
Files
4 (incl. references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

Apply causal inference methods — counterfactual framework, instrumental variables, propensity score matching, and difference-in-differences — to estimate causal effects from observational data.

  • Works in 6 steps: Define the causal question: What is the… → Identify threats to validity: What… → Choose a method: Based on data structure… → …
  • The user needs to determine if X caused Y from non-experimental data
  • SKILL.md covers Framework, Output Format, Gotchas and References
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Stat Causal Inference is an agent skill from asgard-ai-platform/skills. Apply causal inference methods — counterfactual framework, instrumental variables, propensity score matching, and difference-in-differences — to estimate causal effects from observational data. Use this skill when the user needs to determine if X caused Y from non-experimental data, evaluate program/policy impact without a randomized trial, or control for confounders — even if they say 'did this change cause the improvement', 'how do we measure the impact without an experiment', or 'is this correlation or…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `examples/sample_scenario.md`, `references/causal-dags.md` and `references/did-implementation.md`).

It sits in Research & Science, covering Econometrics and empirical research. The repository describes itself as: 301 open-source coding agent skills across 22 domains — methodology, judgment & gotchas packaged as Claude Agent Skills for the Asgard AI Platform. The licence is MIT.

When your agent uses it

  • The user needs to determine if X caused Y from non-experimental data
  • Evaluate program/policy impact without a randomized trial
  • Control for confounders — even if they say did this change cause the improvement
  • How do we measure the impact without an experiment

Example prompts

  • “did this change cause the improvement”
  • “how do we measure the impact without an experiment”
  • “is this correlation or causation”
  • “/stat-causal-inference”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  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?

What it can do on your machine

Read from SKILL.md and the folder at commit 4e7f4f8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stat Causal Inference loads about 1.2k tokens when it runs, and up to ~7.2k if it reads all its reference files. Until then it costs about 136 tokens; SKILL.md has 372 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~136
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from asgard-ai-platform/skills at commit 4e7f4f8, republished under its MIT licence (© asgard-ai-platform). 372 words, ~1,162 tokens.

Download SKILL.mdSave it as .claude/skills/stat-causal-inference/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
stat-causal-inference
description
Apply causal inference methods — counterfactual framework, instrumental variables, propensity score matching, and difference-in-differences — to estimate causal effects from observational data. Use this skill when the user needs to determine if X caused Y from non-experimental data, evaluate program/policy impact without a randomized trial, or control for confounders — even if they say 'did this change cause the improvement', 'how do we measure the impact without an experiment', or 'is this correlation or causation'.
metadata.category
WP-21 設計/資訊/傳播/公衛
metadata.tags
statistics, causal-inference, econometrics

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)
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.

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
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?

Output Format

markdown
# Causal Analysis: {Treatment} → {Outcome}

## Causal Question
- Treatment: {what intervention/event}
- Outcome: {what we're measuring}
- Counterfactual: {what would have happened without treatment}

## 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}

## Results
- Estimated causal effect: {magnitude with CI}
- Robustness checks: {alternative specifications}

## Limitations
{What could still invalidate these results}
Show full SKILL.md (153 more words)Show less

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.

References

  • For directed acyclic graphs (DAGs), see references/causal-dags.md
  • For DID implementation in Python/R, see references/did-implementation.md

© asgard-ai-platform, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in stat-causal-inference of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_scenario.md
  • references/causal-dags.md
  • references/did-implementation.md

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Stat Causal Inference next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Stat Causal Inference compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stat Causal Inference this skillasgard-ai-platform/skills242—~1.2kAutomated safety check: PassMIT
Statadylantmoore/stata-skill2911 repos~4.2kAutomated safety check: PassCustom licence
Stata C Pluginsdylantmoore/stata-skill2911 repos~5.8kAutomated safety check: PassCustom licence
Example Datasetspymc-labs/CausalPy1.2k—~587Automated safety check: PassApache-2.0
Stata AuditSepineTam/mcp-for-stata264—~1.2kAutomated safety check: PassAGPL-3.0
Stata Skill Contributordylantmoore/stata-skill2911 repos~2.4kAutomated safety check: PassCustom licence

Similar skills

  • Stata

    dylantmoore/stata-skill

    Comprehensive Stata reference for writing correct .do files, data management, econometrics, causal inference, graphics, Mata programming, and 20 community packages (reghdfe, estout, did, rdrobust…

    291 GitHub starsUsed in 1 repo~4.2k tokens
    Research & ScienceAuto-check passed
  • Stata C Plugins

    dylantmoore/stata-skill

    Develop high-performance C/C++ plugins for Stata using the stplugin.h SDK.

    291 GitHub starsUsed in 1 repo~5.8k tokens
    Research & ScienceAuto-check passed
  • Example Datasets

    pymc-labs/CausalPy

    Load built-in CausalPy example datasets for demos, tutorials, tests, and quick causal-analysis prototypes.

    1.2k GitHub stars~587 tokensUpdated today
    Research & ScienceAuto-check passed
  • Stata Audit

    SepineTam/mcp-for-stata

    Inspect, validate, summarize, and render local Stata-MCP audit evidence under .statamcp.

    264 GitHub stars~1.2k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed
  • Stata Skill Contributor

    dylantmoore/stata-skill

    Guide for contributing to the stata-skill project. An agent skill from dylantmoore/stata-skill.

    291 GitHub starsUsed in 1 repo~2.4k tokens
    Research & ScienceAuto-check passed
  • Diagnostic Dofile

    SepineTam/mcp-for-stata

    A skill your agent uses when the user needs to inspect, audit, or diagnose the safety of a Stata do-file.

    264 GitHub stars~1.2k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed

More from asgard-ai-platform/skills

All 207 skills in this repo
  • Algo Ecom Bm25

    asgard-ai-platform/skills

    Implement BM25 ranking function for e-commerce product search relevance scoring.

    242 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Mfg Cpk

    asgard-ai-platform/skills

    Calculate Cpk process capability index to assess whether a process meets specification requirements.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Price Elasticity

    asgard-ai-platform/skills

    Calculate price elasticity of demand to quantify how price changes affect sales volume.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Bayesian

    asgard-ai-platform/skills

    Apply Bayesian averaging to rank items by combining observed ratings with prior expectations.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Elo

    asgard-ai-platform/skills

    Implement Elo rating system to rank items or players from pairwise comparison outcomes.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Wilson

    asgard-ai-platform/skills

    Calculate Wilson Score confidence intervals for ranking items by positive proportion with sample size correction.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed

Questions about Stat Causal Inference

What does Stat Causal Inference do?

Apply causal inference methods — counterfactual framework, instrumental variables, propensity score matching, and difference-in-differences — to estimate causal effects from observational data. Stat Causal Inference is an agent skill from asgard-ai-platform/skills. Apply causal inference methods — counterfactual framework, instrumental variables, propensity score matching, and difference-in-differences — to estimate causal effects from observational data.

When should I use Stat Causal Inference?

Stat Causal Inference fits situations like: the user needs to determine if X caused Y from non-experimental data; evaluate program/policy impact without a randomized trial; control for confounders — even if they say did this change cause the improvement; how do we measure the impact without an experiment.

How do I install Stat Causal Inference in Claude Code?

Run `npx skills add asgard-ai-platform/skills --skill stat-causal-inference -a claude-code`. Or copy the skill folder (stat-causal-inference in asgard-ai-platform/skills) into .claude/skills/stat-causal-inference in your project. Claude Code loads it when a task matches its description.

How do I install Stat Causal Inference in Codex?

Run `npx skills add asgard-ai-platform/skills --skill stat-causal-inference -a codex`. Or copy the skill folder (stat-causal-inference in asgard-ai-platform/skills) into .agents/skills/stat-causal-inference in your project. Codex loads it when a task matches its description.

Can I use Stat Causal Inference in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add asgard-ai-platform/skills --skill stat-causal-inference -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stat-causal-inference, .gemini/skills/stat-causal-inference, .github/skills/stat-causal-inference and .opencode/skills/stat-causal-inference in your project.

What does Stat Causal Inference need to run?

SKILL.md names no scripts, command-line tools or credentials: Stat Causal Inference is instructions for the agent only.

Does Stat Causal Inference access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Stat Causal Inference safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Stat Causal Inference use?

Stat Causal Inference is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stat Causal Inference use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6k tokens, read only when the agent opens those files.

What are the alternatives to Stat Causal Inference?

Skills that share tags, products or a category with Stat Causal Inference: Stata (dylantmoore/stata-skill, 291 stars), Stata C Plugins (dylantmoore/stata-skill, 291 stars), Example Datasets (pymc-labs/CausalPy, 1.2k stars) and Stata Audit (SepineTam/mcp-for-stata, 264 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stat Causal Inference?

asgard-ai-platform (a GitHub organization) maintains it in asgard-ai-platform/skills, which has 242 GitHub stars. The repository holds 207 skills in this directory. The repository was last updated on June 6, 2026.

Source: asgard-ai-platform/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.