Agent skill

Causal Inference Guide

by wentorai in wentorai/research-plugins

Causal inference methods including DiD, IV, RDD, and synthetic control

MITAuto-check passedResearch & Science

Install Causal Inference Guide

skills CLI
$ npx skills add wentorai/research-plugins --skill causal-inference-guide -a claude-code

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

GitHub CLI
$ gh skill install wentorai/research-plugins causal-inference-guide --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/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/analysis/econometrics/causal-inference-guide .claude/skills/causal-inference-guide && 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
causal-inference-guide
GitHub stars
298
Used in
1 other repo
Token cost
~1.7k tokens
SKILL.md length
156 words
Files
1
Skills in repo
405
Repo updated
First seen
Licence
MIT

At a glance

Causal inference methods including DiD, IV, RDD, and synthetic control

  • Works in 3 steps: Relevance: First-stage F > 10 (Stock &… → Exclusion restriction: Instrument… → Overidentification test: Sargan/Hansen…
  • Tasks that involve Econometrics and empirical research
  • SKILL.md covers Difference-in-Differences (DiD), Instrumental Variables (IV), Regression Discontinuity… and Best Practices
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Causal Inference Guide is an agent skill from wentorai/research-plugins. Causal inference methods including DiD, IV, RDD, and synthetic control

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Econometrics and empirical research. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.

When your agent uses it

  • Tasks that involve Econometrics and empirical research

Example prompts

  • “/causal-inference-guide”

Requirements

  • Python 3

Workflow steps

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

  1. Relevance: First-stage F > 10 (Stock & Yogo, 2005)
  2. Exclusion restriction: Instrument affects outcome only through the endogenous variable (untestable, argue conceptually)
  3. Overidentification test: Sargan/Hansen J-test when you have more instruments than endogenous variables

What it can do on your machine

Read from SKILL.md and the folder at commit bf44b3c. 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 python).

    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

Causal Inference Guide loads about 1.7k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 156 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

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 wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 156 words, ~1,732 tokens.

Download SKILL.mdSave it as .claude/skills/causal-inference-guide/SKILL.md (or your agent's skills folder).
name
causal-inference-guide
description
Causal inference methods including DiD, IV, RDD, and synthetic control

Causal Inference Guide

A skill for applying quasi-experimental causal inference methods in observational research. Covers difference-in-differences, instrumental variables, regression discontinuity designs, and synthetic control methods with implementation code and diagnostic checks.

Difference-in-Differences (DiD)

Classic Two-Period DiD
python
import numpy as np
import pandas as pd
import statsmodels.formula.api as smf

def did_estimation(df: pd.DataFrame, outcome: str, treatment: str,
                    post: str, covariates: list[str] = None) -> dict:
    """
    Estimate a difference-in-differences model.

    Args:
        df: Panel DataFrame
        outcome: Name of outcome variable column
        treatment: Name of treatment group indicator (0/1)
        post: Name of post-treatment period indicator (0/1)
        covariates: Optional list of control variable names
    """
    # Create interaction term
    df = df.copy()
    df['did'] = df[treatment] * df[post]

    # Build formula
    formula = f"{outcome} ~ {treatment} + {post} + did"
    if covariates:
        formula += ' + ' + ' + '.join(covariates)

    model = smf.ols(formula, data=df).fit(cov_type='cluster',
                                           cov_kwds={'groups': df.get('unit_id', df.index)})

    return {
        'did_estimate': model.params['did'],
        'se': model.bse['did'],
        'p_value': model.pvalues['did'],
        'ci_95': (model.conf_int().loc['did', 0], model.conf_int().loc['did', 1]),
        'r_squared': model.rsquared,
        'n_obs': model.nobs,
        'interpretation': (
            f"The treatment effect is {model.params['did']:.3f} "
            f"(SE = {model.bse['did']:.3f}, p = {model.pvalues['did']:.4f}). "
            f"{'Statistically significant' if model.pvalues['did'] < 0.05 else 'Not significant'} "
            f"at the 5% level."
        )
    }

The key identifying assumption. Test it with pre-treatment data:

python
def test_parallel_trends(df: pd.DataFrame, outcome: str,
                          treatment: str, time: str,
                          treatment_period: int) -> dict:
    """
    Test the parallel trends assumption using event study specification.
    """
    df = df.copy()
    pre_periods = sorted(df[df[time] < treatment_period][time].unique())

    # Create period dummies interacted with treatment
    for t in pre_periods:
        df[f'pre_{t}'] = ((df[time] == t) & (df[treatment] == 1)).astype(int)

    period_vars = [f'pre_{t}' for t in pre_periods[:-1]]  # omit last pre-period (reference)
    formula = f"{outcome} ~ {' + '.join(period_vars)} + C({time}) + C(unit_id)"

    model = smf.ols(formula, data=df).fit()

    # Joint F-test: all pre-treatment interactions = 0
    f_test = model.f_test(' = '.join([f'{v} = 0' for v in period_vars]))

    return {
        'pre_period_coefficients': {v: model.params[v] for v in period_vars},
        'f_statistic': f_test.fvalue[0][0],
        'f_pvalue': f_test.pvalue,
        'parallel_trends_hold': f_test.pvalue > 0.05,
        'interpretation': (
            'Parallel trends assumption supported (cannot reject joint null)'
            if f_test.pvalue > 0.05
            else 'WARNING: Parallel trends assumption may be violated'
        )
    }

Instrumental Variables (IV)

Two-Stage Least Squares
python
from linearmodels.iv import IV2SLS

def iv_estimation(df: pd.DataFrame, outcome: str, endogenous: str,
                   instrument: str, exogenous: list[str] = None) -> dict:
    """
    Estimate an IV model using 2SLS.

    Args:
        outcome: Dependent variable
        endogenous: Endogenous regressor
        instrument: Instrumental variable
        exogenous: List of exogenous control variables
    """
    exog_formula = '1'
    if exogenous:
        exog_formula += ' + ' + ' + '.join(exogenous)

    model = IV2SLS(
        dependent=df[outcome],
        exog=df[exogenous] if exogenous else None,
        endog=df[[endogenous]],
        instruments=df[[instrument]]
    ).fit(cov_type='robust')

    # First-stage F-statistic
    first_stage = smf.ols(f"{endogenous} ~ {instrument}", data=df).fit()
    f_stat = first_stage.fvalue

    return {
        'iv_estimate': model.params[endogenous],
        'se': model.std_errors[endogenous],
        'p_value': model.pvalues[endogenous],
        'first_stage_F': f_stat,
        'weak_instrument': f_stat < 10,  # Stock-Yogo rule of thumb
        'interpretation': (
            f"IV estimate: {model.params[endogenous]:.3f}. "
            f"First-stage F = {f_stat:.1f} "
            f"({'Strong' if f_stat >= 10 else 'WEAK'} instrument)."
        )
    }
IV Diagnostic Checklist
  1. Relevance: First-stage F > 10 (Stock & Yogo, 2005)
  2. Exclusion restriction: Instrument affects outcome only through the endogenous variable (untestable, argue conceptually)
  3. Overidentification test: Sargan/Hansen J-test when you have more instruments than endogenous variables

Regression Discontinuity Design (RDD)

python
def rdd_estimation(df: pd.DataFrame, outcome: str, running_var: str,
                    cutoff: float, bandwidth: float = None) -> dict:
    """
    Sharp regression discontinuity design estimation.
    """
    df = df.copy()
    df['centered'] = df[running_var] - cutoff
    df['treated'] = (df[running_var] >= cutoff).astype(int)

    if bandwidth is None:
        bandwidth = df['centered'].std()  # simple default

    # Restrict to bandwidth
    local = df[df['centered'].abs() <= bandwidth]

    # Local linear regression
    formula = f"{outcome} ~ treated * centered"
    model = smf.ols(formula, data=local).fit(cov_type='HC1')

    return {
        'rdd_estimate': model.params['treated'],
        'se': model.bse['treated'],
        'p_value': model.pvalues['treated'],
        'bandwidth': bandwidth,
        'n_obs': len(local),
        'n_treated': local['treated'].sum(),
        'n_control': len(local) - local['treated'].sum()
    }

Best Practices

  • Always visualize your data: plot outcome trends over time (DiD), first-stage relationships (IV), or running variable distributions (RDD)
  • Report robustness checks: varying bandwidths, alternative specifications, placebo tests
  • Use cluster-robust standard errors at the appropriate level (usually the treatment unit level)
  • Be transparent about identifying assumptions and potential violations
  • Pre-register your analysis plan when possible to avoid p-hacking concerns

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

Files

Just SKILL.md in skills/analysis/econometrics/causal-inference-guide of wentorai/research-plugins.

Open the folder on GitHubat commit bf44b3c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Causal Inference Guide 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.

Causal Inference Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Causal Inference Guide this skillwentorai/research-plugins2981 repos~1.7kAutomated 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 wentorai/research-plugins

All 405 skills in this repo
  • Abstract Writing Guide

    wentorai/research-plugins

    Craft structured research abstracts that maximize clarity and journal acceptance

    298 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Academic Citation Manager

    wentorai/research-plugins

    Manage academic citations across BibTeX, APA, MLA, and Chicago formats

    298 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Academic Paper Summarizer

    wentorai/research-plugins

    Summarize academic papers with structured extraction of key elements

    298 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Academic Study Methods

    wentorai/research-plugins

    Evidence-based study techniques for academic learning and retention

    298 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Academic Tone Guide

    wentorai/research-plugins

    Adjust writing tone and register for academic audiences and venues

    298 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Academic Translation Guide

    wentorai/research-plugins

    Academic translation, post-editing, and Chinglish correction guide

    298 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed

Questions about Causal Inference Guide

What does Causal Inference Guide do?

Causal inference methods including DiD, IV, RDD, and synthetic control. Causal Inference Guide is an agent skill from wentorai/research-plugins.

When should I use Causal Inference Guide?

Causal Inference Guide fits situations like: tasks that involve Econometrics and empirical research.

How do I install Causal Inference Guide in Claude Code?

Run `npx skills add wentorai/research-plugins --skill causal-inference-guide -a claude-code`. Or copy the skill folder (skills/analysis/econometrics/causal-inference-guide in wentorai/research-plugins) into .claude/skills/causal-inference-guide in your project. Claude Code loads it when a task matches its description.

How do I install Causal Inference Guide in Codex?

Run `npx skills add wentorai/research-plugins --skill causal-inference-guide -a codex`. Or copy the skill folder (skills/analysis/econometrics/causal-inference-guide in wentorai/research-plugins) into .agents/skills/causal-inference-guide in your project. Codex loads it when a task matches its description.

Can I use Causal Inference Guide 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 wentorai/research-plugins --skill causal-inference-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/causal-inference-guide, .gemini/skills/causal-inference-guide, .github/skills/causal-inference-guide and .opencode/skills/causal-inference-guide in your project.

What does Causal Inference Guide need to run?

SKILL.md names no scripts, command-line tools or credentials: Causal Inference Guide is instructions for the agent only. Our summary lists: Python 3.

Does Causal Inference Guide 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 Causal Inference Guide 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 Causal Inference Guide use?

Causal Inference Guide 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 Causal Inference Guide use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Causal Inference Guide?

Skills that share tags, products or a category with Causal Inference Guide: 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 Causal Inference Guide?

wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 405 skills in this directory. The repository was last updated on June 19, 2026.

Source: wentorai/research-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.