statsmodels · davila7 — Claude Code skill: stats and econometrics
A skill for regressions, GLM, time series and hypothesis tests inside Claude. Useful when you need inference on coefficients, not just predictions.
npx claude-code-templates@latest --skill scientific/statsmodelsWhat statsmodels 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.
What it helps with
- 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 for the agent
- 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
How to install statsmodels
1claude-code-templates
npx claude-code-templates@latest --skill scientific/statsmodels2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill statsmodels -a claude-code3Manually: put the files in place
~/.claude/skills/statsmodels/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/statsmodels/
Manually: put the files in place
.agents/skills/statsmodels/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/statsmodels/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates statsmodels2Manually: put the files in place
.github/skills/statsmodels/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/scientific/statsmodelsManually: put the files in place
.devin/skills/statsmodels/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about statsmodels
How do I install statsmodels in Claude?
Use the templates command: npx claude-code-templates@latest --skill scientific/statsmodels. Or run npx skills add davila7/claude-code-templates --skill statsmodels -a claude-code. The skill file lands at ~/.claude/skills/statsmodels/SKILL.md.
What does the statsmodels skill do?
It gives the agent guidance on statistical modeling in Python: linear and generalized linear models, discrete choice, time series, plus tests and residual diagnostics.
What do I need for the statsmodels skill to work?
Python and the statsmodels library installed. The examples also use pandas, numpy, matplotlib and sklearn — for instance to score a logistic regression.
Similar skills
All skills for Data and databases →statsmodels by other authors comes first.