# statsmodels

This skill teaches the agent to fit and diagnose Python statistical models: OLS, GLM, discrete outcomes and time series. Useful when you need coefficients plus a check on model assumptions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2100 installs · ★ 54652
- Author: K-Dense-AI
- License: LicenseRef-BSD-3-Clause-license · policy=link-only · description only; the file stays with the author
- Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/statsmodels/SKILL.md
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/skills/k-dense-ai-statsmodels

## What it does

The skill covers `statsmodels` in Python: linear models (OLS, WLS, GLS, quantile regression), generalized linear models, discrete choice, count and ordinal outcomes, ARIMA, SARIMAX, VAR and forecasting. Diagnostics get their own treatment — heteroskedasticity, autocorrelation, residual normality, outliers and influential points, model comparison via AIC/BIC and likelihood ratio tests.

Inside are reference files: a quick start with small worked examples for OLS, logistic regression, ARIMA and GLM, an overview of modeling capabilities, model selection and the R-style formula API, plus per-topic files on linear models, GLM, discrete choice, time series and diagnostics. The agent gets `Read`, `Write`, `Edit` and `Bash`.

You need Python 3.10+ and `statsmodels` 0.15.0; the tested NumPy 2.5.3 and SciPy 1.18.1 stack calls for Python 3.12+. Plotting requires matplotlib, predictive metrics require scikit-learn. Network access matters only for installation or docs, and no credentials are involved. Install into a dedicated environment: `uv pip install statsmodels==0.15.0 numpy==2.5.3 scipy==1.18.1 pandas==3.0.6 matplotlib==3.11.2 scikit-learn==1.9.1`. Mismatched NumPy and SciPy versions are where things break — 0.15 moved several tests to `result_object=True` with named fields, and `rng=` replaces the older `seed` and `random_state` arguments.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill statsmodels -a claude-code
```

2. **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

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill statsmodels -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill statsmodels -a cursor
```

2. **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 K-Dense-AI/scientific-agent-skills statsmodels
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill statsmodels -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/K-Dense-AI/scientific-agent-skills --path skills/statsmodels
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill statsmodels -a opencode
```

### 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/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/statsmodels/SKILL.md

## When to use it
- fit an OLS model and test residuals for heteroskedasticity
- estimate a logistic regression and compute marginal effects
- handle overdispersion in count data by switching to negative binomial
- build an ARIMA or SARIMAX forecast
- compare nested models with AIC/BIC and a likelihood ratio test

## Example prompts
- Fit OLS with the formula `y ~ x1 + x2` and show residual diagnostics
- Check this Poisson model for overdispersion and move to negative binomial if it shows up
- Run SARIMAX on this series and give me the forecast with confidence intervals

## Similar
- [xlsx](https://affpapa.org/en/nevibecode/skills/xlsx.md) — skill · 187223 installs
- [google-agents-cli-observability](https://affpapa.org/en/nevibecode/skills/google-agents-cli-observability.md) — skill · 511300 installs
- [caveman-evidence-review](https://affpapa.org/en/nevibecode/skills/caveman-evidence-review.md) — skill · 104500 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs
- [performance-optimization](https://affpapa.org/en/nevibecode/skills/performance-optimization.md) — skill · 65200 installs
- [supabase](https://affpapa.org/en/nevibecode/skills/supabase.md) — skill · 8 installs

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

From the same set: [k-dense-ai/scientific-agent-skills](https://affpapa.org/en/nevibecode/by/k-dense-ai/scientific-agent-skills.md) — 159 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
