statsmodels
Statistical models library for Python. Use when you need specific model classes (OLS, GLM, mixed models, ARIMA) with detailed diagnostics, residuals, and inference. Best for econometrics, time series, rigorous inference with coefficient tables. For guided statistical test selection with APA reporting use statistical-analysis.
npx skills add majiayu000/claude-skill-registry --skill scientific-statsmodels-blurjp-imageprepmcp --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Describes a skill that guides an AI agent to perform statistical modeling tasks using Python's Statsmodels library. It covers fitting various model classes (OLS, WLS, GLS, GLSAR, Quantile Regression, Mixed Effects, ARIMA, SARIMAX, VAR, GLM, Logit, Poisson, Negative Binomial, etc.), running diagnostics, producing inference, and generating publication-ready tables. It includes concrete code snippets and step-by-step workflows for linear regression, logistic regression, time series modeling, GLMs, discrete choice models, and general diagnostic procedures.
How it works
The skill outlines concrete usage patterns and code examples to perform:
- Data preparation steps (e.g., adding a constant with sm.add_constant, handling missing values)
- Fitting models via the Statsmodels API (e.g., sm.OLS, Logit, ARIMA, GLM) and formulas via smf when applicable
- Generating summaries and extracting results (e.g., results.summary(), results.params, results.pvalues, results.get_prediction())
- Computing additional statistics (odds ratios, rate ratios, marginal effects, AIC/BIC, likelihood ratio tests)
- Performing model diagnostics (residual plots, heteroskedasticity tests, autocorrelation tests, overdispersion checks)
- Visualization steps (residual plots, diagnostic plots, forecast plots) and interpreting outputs
- Model comparison and cross-validation patterns (AIC/BIC, LR tests, cross-validation snippets)
- Time series specifics (ADF for stationarity, differencing, ACF/PACF visualization, ARIMA fitting, forecasting, residual diagnostics)
- Generalized Linear Models with various families and link functions, including Poisson, Binomial, Negative Binomial, Gamma, Tweedie, etc., and evaluating fit and dispersion
The content includes concrete code blocks and concrete commands like importing modules, adding constants, fitting models, and printing summaries.
When to use it
Use this skill when you need to fit statistical models across a broad set of outcomes (continuous, binary, count) and time series data, perform diagnostics, and produce inference-ready results suitable for publication or reporting. It is optimized for econometrics, time series, and rigorous inference contexts with coefficient tables.
# Statsmodels: Statistical Modeling and Econometrics ## Overview Statsmodels is Python's premier library for statistical modeling, providing tools for estimation, inference, and diagnostics across a wide range of statistical methods. Apply this skill for rigorous statistical analysis, from simple linear regression to complex time series models and econometric analyses. ## When to Use This Skill This skill should be used when: - Fitting regression models (OLS, WLS, GLS, quantile regression) - Performing generalized linear modeling (logistic, Poisson, Gamma, etc.) - Analyzing discrete outcomes (binary, multinomial, count, ordinal) - Conducting time series analysis (ARIMA, SARIMAX, VAR, forecasting) - Running statistical tests and diagnostics - Testing model assumptions (heteroskedasticity, autocorrelation, normality) - Detecting outliers and influential observations - Comparing models (AIC/BIC, likelihood ratio tests) - Estimating causal effects - Producing publication-ready statistical tables and inference ## Quick Start Guide ### Linear Regression (OLS) ```python import statsmodels.api as sm import numpy as np import pandas as pd # Prepare data - ALWAYS add constant for intercept X
- Overview
- When to Use This Skill
- Quick Start Guide
- Linear Regression (OLS)
- Logistic Regression (Binary Outcomes)
- Time Series (ARIMA)
- Generalized Linear Models (GLM)
- Core Statistical Modeling Capabilities
- 1. Linear Regression Models
- 2. Generalized Linear Models (GLM)
- 3. Discrete Choice Models
- 4. Time Series Analysis
- 5. Statistical Tests and Diagnostics
- Formula API (R-style)
Find information about specific models grep -r "Quantile Regression" references/ Find diagnostic tests grep -r "Breusch-Pagan" references/stats_diagnostics.md Find time series guidance grep -r "SARIMAX" references/time_series.md
What does the statsmodels skill do?
Statistical models library for Python. Use when you need specific model classes (OLS, GLM, mixed models, ARIMA) with detailed diagnostics, residuals, and inference. Best for econometrics, time series, rigorous inference with coefficient tables. For guided statistical test selection with APA reporting use statistical-analysis.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill scientific-statsmodels-blurjp-imageprepmcp --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
