# statsmodels

A skill for regressions, GLM, time series and hypothesis tests inside Claude. Useful when you need inference on coefficients, not just predictions.

- skill · `type=skill` · Claude Code · 97 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/scientific/statsmodels
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/statsmodels

## What it does

The skill covers statsmodels work: linear models (OLS, WLS, GLS, quantile regression), generalized linear models across distribution families, discrete choice models and time series such as ARIMA. It ships Python examples — adding a constant with `sm.add_constant`, reading `results.summary()`, pulling coefficients and p-values, building forecasts with confidence intervals.

Diagnostics get their own section. Breusch-Pagan for heteroskedasticity, the Dickey-Fuller test for stationarity, ACF and PACF plots to pick ARIMA orders, residual and influence statistics. Model comparison runs on AIC, BIC and likelihood ratio tests. Logistic regression comes with odds ratios and marginal effects via `get_margeff`.

The skill assumes Python and the statsmodels library, so a project without Python gets nothing from it. Several examples also pull in pandas, numpy, matplotlib and sklearn for metrics like AUC — worth checking your environment before asking the agent to fit a model.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill scientific/statsmodels
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill statsmodels -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/statsmodels/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/statsmodels/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/statsmodels/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/statsmodels/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates statsmodels
```

2. **Manually: put the files in place**
- File: `.github/skills/statsmodels/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/scientific/statsmodels
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/statsmodels/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/scientific/statsmodels

## When to use it
- fit an OLS regression and report coefficients with p-values
- test residuals for heteroskedasticity and autocorrelation
- compare candidate models by AIC and BIC
- forecast a series with ARIMA and confidence intervals
- compute odds ratios for a logistic regression

## Example prompts
- fit an OLS regression on this dataset and show me the summary with coefficients
- check this time series for stationarity with the Dickey-Fuller test and pick ARIMA orders
- compare these two models by AIC and BIC and explain the difference

## Similar
- [Time Series Analysis](https://affpapa.org/en/nevibecode/skills/time-series-analysis.md) — skill · 605 installs
- [cointegration-analysis](https://affpapa.org/en/nevibecode/skills/cointegration-analysis.md) — skill · 455 installs
- [mean-reversion](https://affpapa.org/en/nevibecode/skills/mean-reversion.md) — skill · 490 installs
- [statistical-power](https://affpapa.org/en/nevibecode/skills/statistical-power.md) — skill · 1300 installs
- [Causal Inference](https://affpapa.org/en/nevibecode/skills/causal-inference.md) — skill · 534 installs

## Other versions with the same name
- [statsmodels · k-dense-ai](https://affpapa.org/en/nevibecode/skills/k-dense-ai-statsmodels.md) — 2100 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 205 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
