statspai-analysis

statspai-analysis is a skill for Claude Code, Codex from brycewang-stanford/StatsPAI. It costs 205 tokens per session (1,664 once invoked), scanned A, original, MIT.

A Python workflow for empirical and causal analysis, using methods such as difference-in-differences, regression discontinuity, instrumental variables, matching, and synthetic controls. It produces analysis results and exports tables and figures for papers.

In plain words
What is it for?
Use it to analyse experimental or observational data, build event-study figures, create research tables, and export results to Word, Excel, LaTeX, or BibTeX.
Why use it?
It reduces the work of choosing an analysis method, checking its assumptions, running robustness checks, and preparing results in common research formats.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to analyse experimental or observational data, build event-study figures, create research tables, and export results to Word, Excel, LaTeX, or BibTeX.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/brycewang-stanford/statspai/_skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add brycewang-stanford/StatsPAI --skill _skill
Clone the repo
git clone --depth 1 https://github.com/brycewang-stanford/StatsPAI

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for statspai-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/brycewang-stanford/statspai/_skill/github.svg)](https://agentmods.dev/skills/brycewang-stanford/statspai/_skill)
Your own site
<a href="https://agentmods.dev/skills/brycewang-stanford/statspai/_skill"><img src="https://agentmods.dev/badge/skills/brycewang-stanford/statspai/_skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for statspai-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/brycewang-stanford/statspai/_skill"><img src="https://agentmods.dev/badge/skills/brycewang-stanford/statspai/_skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 205 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,664 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00205 $0.01664
Opus 5.5 $0.00082 $0.00666
Sonnet 5.5 $0.00041 $0.00333
Haiku 4.5 $0.00020 $0.00166

Measured today against content hash 24694cf14094, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

statspai-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 1 executable file (validate_api_claims.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/statspai/agent/_skill/SKILL.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

StatsPAI analysis

One import statspai as sp covers causal inference and applied econometrics, with self-describing functions and results that export to LaTeX / Word / Excel.

Read only what the request needs

Request Read
one estimate, one check or one export references/quick-path.md
a whole DID study, pre-flight, Stata / R script, reviewer audit references/one-call-workflows.md
a full paper, Table 1 through robustness references/pipeline-econ.md (one step at a time); references/verified-skeleton.md to copy
target trial, g-formula, TMLE, MR, survival references/pipeline-epi.md
DML, meta-learners, causal forest, policy, conformal, fairness references/pipeline-ml-causal.md
tables, journal styles, Word / Excel bundles, figures references/export.md
robust staggered DID, event-study bands, few treated units, weak IV, forests, dynamic DML references/modern-methods.md
decomposition, forecasting, experiments, survey, survival, Bayes references/other-methods.md
which function for a method family; alternatives references/method-catalog.md
silent traps, result-object attributes references/common-mistakes.md
MCP or shell instead of Python references/mcp-and-cli.md
acceptance gates, mode table, figure / table inventory references/operating-loop.md

Loop

  1. Scope. Do what was asked. "Make Table 1" is not a paper pipeline.
  2. Contract before estimating. Name outcome, treatment, unit, time, estimand, design and the files to produce. If a needed column or a design fact (staggered? never-treated group? cutoff?) is not in the data or the request, ask. Do not invent it.
  3. Route. sp.route("did", design="staggered", timing_random="no", covariates="none") (also iv, rd, matching, ml_causal, qte, dynamic_panel); sp.recommend(df, ...) reads the data; sp.preflight(df, method, ...) checks it before fitting.
  4. Describe, then call. sp.search_functions("..."), sp.describe_function(name), sp.function_schema(name). Never write an unfamiliar signature from memory.
  5. Inspect, then report. r.violations(), r.next_steps(), r.degradations, sp.audit(r). A check that did not run is not a check that passed.
  6. Answer with evidence. Estimate, SE, CI, N, estimand, identifying assumption, files written, and every failed or skipped gate. Never say "paper-ready" when an export or a required diagnostic did not run.
  7. On error, apply the recovery_hint / alternative_functions of the StatsPAIError to the one wrong thing and continue.

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · -57 lines · -66 tokens per session 24694cf14094
  2. 1mo ago Changed · +12 lines · +30 tokens per session 98652fd173b2
  3. 1mo ago Changed · +7 lines 6db351d9ff9c
  4. 2mo ago First seen · 140 lines · 241 tokens per session scan A 11f41d649b4c

Subscribe to this mod's changes

statspai-analysis is a skill published in the GitHub repository brycewang-stanford/StatsPAI (389 stars, last pushed today), licensed MIT. It adds 205 tokens to every session and 1,664 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-29.

Related

statspai-analysis compared with skills from other repositories

statspai-analysis next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
statspai-analysisbrycewang-stanford/StatsPAISkill389todayMITA205Claude Code, Codex
fin-paper-figurecsmar432/finai-researchSkill1127d agoMITA14Claude Code, Codex
fin-paper-writingcsmar432/finai-researchSkill1127d agoMITA65Claude Code
fin-data-acquisitioncsmar432/finai-researchSkill1127d agoMITA36Claude Code, Codex
fin-viz-launchcsmar432/finai-researchSkill1127d agoMITA45Claude Code, Codex
fin-lit-reviewcsmar432/finai-researchSkill1127d agoMITA49Claude Code
fin-submit-checkcsmar432/finai-researchSkill1127d agoMITA37Claude Code, Codex