Skip to main content
skill CX Codex

StatsPAI_skill — Claude Code skill: causal inference in Python

Wires the statspai Python package into a session: descriptives, estimator choice, treatment-effect estimation and post-estimation checks.

no license ★ 240 updated 2026-09-18

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add franklee16/academic-research-skills --skill statspai_skill -a claude-code
Open on GitHub

What StatsPAI_skill does

The skill gives a Claude agent a single entry point to statspai: one import statspai as sp, 900+ functions behind a shared API. Work starts at descriptives and balance tables (sp.sumstats, sp.balance_table), passes through the research-question DSL sp.causal_question and ends at estimation via sp.causal or a named estimator. Classical methods cover OLS, IV, DID including staggered adoption, RDD, PSM and SCM; the ML side has DML, Causal Forest, Meta-Learners and TMLE.

Function discovery is built in. sp.list_functions(), sp.describe_function("did") and sp.function_schema("rdrobust") return schemas the model can read without opening docs. Estimators hand back a result object with .summary(), .plot(), .to_latex(), .to_word(), .to_excel(), .cite() plus a diagnostics dict that agent logic can branch on. Separate steps handle DAG proposals (sp.llm_dag_propose, sp.llm_dag_validate), text as treatment (sp.causal_text) and post-estimation checks (sp.diagnose, sp.spec_curve, sp.honest_did).

Cleaning stays out of scope. Missing values, type coercion and merges belong in pandas before the first sp.* call. Skip that and an estimator either raises or drops rows silently, which is your bug rather than the skill's. Draft writing through sp.paper() is excluded too; the flow stops at diagnostics and hands the result back.

What it helps with

  • Estimate a training effect on wages with panel DID
  • Pick between DID, RDD and IV for a stated estimand
  • Build a covariate balance table before estimation
  • Stress-test a fitted model with a specification curve and HonestDiD
  • Locate the right package function from its schema

Example prompts for the agent

  • Run a DID estimate of the training effect on wages, panel keyed on worker_id and year
  • Use sp.causal_question to decide between DID, RDD and IV on this data
  • Propose a DAG with sp.llm_dag_propose, then run sp.diagnose on the model

How to install StatsPAI_skill

1Skills CLI (Vercel)

npx skills add franklee16/academic-research-skills --skill statspai_skill -a claude-code

2Manually: put the files in place

~/.claude/skills/StatsPAI_skill/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/StatsPAI_skill/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about StatsPAI_skill

How do I install StatsPAI_skill in Claude Code?

Run npx skills add franklee16/academic-research-skills --skill StatsPAI_skill -a claude-code. The skill file lands at ~/.claude/skills/StatsPAI_skill/SKILL.md.

What does StatsPAI_skill do?

It walks an agent through an empirical analysis in Python: descriptives, choosing an estimator for a declared estimand, estimating a treatment effect and running post-estimation checks. All from the single statspai import.

Does the skill handle data cleaning?

No. Missing values, type coercion and joins stay in pandas, because sp.* expects an analysis-ready DataFrame. On messy input an estimator will raise or drop rows without telling you.

Similar skills

All skills for Science and research →

From the same set98

The whole set →
research-brainstorm The research-brainstorm skill sharpens research questions, scans related literature, challenges an idea, and assesses feasibility. Use it to develop a project or test its novelty. CX Codex +1 ★ 240repo stars econane econane finds documented real-world cases behind an economics argument and merges them with the academic findings in one evidence memo. CX Codex +1 ★ 240repo stars paper-reading-theoretical-grounding paper-reading-theoretical-grounding — a Claude Code skill that helps you find theoretical support for a research problem. CX Codex +1 ★ 240repo stars jf-writing-style-guide The jf-writing-style-guide skill helps draft and polish finance research in the style of the Journal of Finance, including Chinese-to-English translation. Use it when editing a paper section or reviewing the paper’s style. CX Codex +1 ★ 240repo stars beamer-ppt beamer-ppt is a Claude Code skill that builds LaTeX Beamer presentations one slide at a time and shows PDF previews in chat. CX Codex +1 ★ 240repo stars marketing-science-writing The marketing-science-writing skill helps shape marketing science papers, from research framing and method choice to managerial implications. Use it when drafting or revising work for a marketing journal. CX Codex +1 ★ 240repo stars citation-check-skill citation-check-skill is a Claude Code skill that checks claims in slides, reports and PDFs against web sources or supplied documents, flagging fabricated citations. CX Codex +1 ★ 240repo stars 18-writeup 18-writeup drafts academic research papers in LaTeX across 12 focused passes, grounding every claim in workspace evidence without guessing. GP ChatGPT ★ 240repo stars

Project sponsors

Companies that keep this analytics open