Fits and interprets statistical models in Python with statsmodels: OLS, GLM, discrete-choice, mixed models, ARIMA/SARIMAX/VAR. Includes diagnostics, robust standard errors, and coefficient-level inference for econometrics and time series.
Ships in alterlab-data-science. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
This skill should be used when:
| Scenario | Use Instead |
|---|---|
| Choosing which test fits the design, checking assumptions, and writing APA-style results | alterlab-statistical-analysis |
| Bayesian or hierarchical models with posterior distributions (PyMC, NUTS) | alterlab-pymc |
| Quasi-experimental causal designs (DiD, IV, RD, panel fixed effects, event studies) as a full workflow | alterlab-causal-inference |
| Predictive machine learning with cross-validated tuning rather than coefficient inference | alterlab-scikit-learn |
| Zero-shot forecasting with a pretrained foundation model instead of fitting ARIMA/ETS | alterlab-timesfm |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-statistical-analysis) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
statsmodels 0.15.0 (Aug 2026) is the first release since 0.14 (2023). Changes that affect everyday code:
adfuller, kpss, acf (with qstat/alpha), het_arch, acorr_lm, acorr_breusch_godfrey, het_goldfeldquandt and a few others still return the legacy tuple but emit a FutureWarning; pass result_object=True to get the named result now (e.g. adfuller(y, result_object=True).pvalue, het_arch(r, result_object=True).lmpval). The default switches in 0.16.seed= / random_state= arguments are deprecated in favor of rng= (SPEC 7).grangercausalitytests(verbose=...), AutoReg(old_names=...); kpss(nlags=None) now raises — pass 'auto', 'legacy', or an integer.SM_FORMULA_ENGINE=formulaic. Model and formula APIs also accept Polars DataFrames.pairwise_tukeyhsd(..., use_var="unequal")), the Leybourne-McCabe stationarity test (statsmodels.tsa.stattools.leybourne), MultivariateLS, and robust MM/S estimators.Copy-paste starting points for OLS, logistic regression, ARIMA, GLM/Poisson, and the R-style formula API are in references/quickstart_examples.md. Core rule: always sm.add_constant() for an intercept unless you deliberately want none.
Comprehensive suite of linear models for continuous outcomes with various error structures.
Available models:
Key features:
When to use: Continuous outcome variable, want inference on coefficients, need diagnostics
Reference: See references/linear_models.md for detailed guidance on model selection, diagnostics, and best practices.
Flexible framework extending linear models to non-normal distributions.
Distribution families:
Link functions:
Key features:
When to use: Non-normal outcomes, need flexible variance and link specifications
Reference: See references/glm.md for family selection, link functions, interpretation, and diagnostics.
Models for categorical and count outcomes.
Binary models:
Multinomial models:
Count models:
Key features:
When to use: Binary, categorical, or count outcomes
Reference: See references/discrete_choice.md for model selection, interpretation, and evaluation.
Comprehensive time series modeling and forecasting capabilities.
Univariate models:
Multivariate models:
Advanced models:
Key features:
When to use: Time-ordered data, forecasting, understanding temporal dynamics
Reference: See references/time_series.md for model selection, diagnostics, and forecasting methods.
Extensive testing and diagnostic capabilities for model validation.
Residual diagnostics:
Influence and outliers:
Hypothesis testing:
Multiple comparisons:
Effect sizes and power:
Robust inference:
When to use: Validating assumptions, detecting problems, ensuring robust inference
Reference: See references/stats_diagnostics.md for comprehensive testing and diagnostic procedures.
smf.ols, smf.logit, smf.poisson, interactions, C(), I()) → references/quickstart_examples.md.references/model_selection.md.references/workflows_and_practices.md.references/linear_models.md.references/glm.md.references/discrete_choice.md.references/time_series.md.references/stats_diagnostics.md.references/model_selection.md.references/quickstart_examples.md — copy-paste OLS / Logit / ARIMA / GLM examples and the R-style formula API.references/linear_models.md — OLS, WLS, GLS, GLSAR, quantile, mixed effects, recursive/rolling; diagnostics, influence, robust SEs, hypothesis testing.references/glm.md — all distribution families, link functions, interpretation, pseudo R-squared, residual analysis.references/discrete_choice.md — binary (Logit/Probit), multinomial, count (Poisson/NB/ZIP/ZINB/hurdle), ordinal, marginal effects.references/time_series.md — AR/ARIMA/SARIMAX/ETS, VAR/VARMAX/dynamic factor, state space, stationarity, forecasting, Granger/IRF/FEVD.references/stats_diagnostics.md — residual diagnostics, influence/outliers, parametric and non-parametric tests, ANOVA, multiple comparisons, robust covariances, power/effect sizes.references/model_selection.md — AIC/BIC comparison, likelihood ratio test, cross-validation.references/workflows_and_practices.md — best practices, end-to-end workflows, common pitfalls, search patterns, official docs links.Part of the AlterLab Academic Skills suite.
evals/evals.json (opens in a new tab)references/discrete_choice.md (opens in a new tab)references/glm.md (opens in a new tab)references/linear_models.md (opens in a new tab)references/model_selection.md (opens in a new tab)references/quickstart_examples.md (opens in a new tab)references/stats_diagnostics.md (opens in a new tab)references/time_series.md (opens in a new tab)references/workflows_and_practices.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/alterlab-data-science:alterlab-statsmodelsfrom alterlab-data-science
npx claudepluginhub alterlab-ieu/alterlab-academic-skills --plugin alterlab-data-science22 skills in this plugin
/alterlab-daskScales pandas/NumPy workflows beyond memory with Dask distributed computing — parallel DataFrames, arrays, delayed task graphs, and cluster execution. Use when existing pandas/NumPy code must run on larger-than-RAM data or across clusters, for parallel file processing, distributed ML, or integration with existing pandas code. For out-of-core analytics on a single machine prefer vaex; for in-memory speed prefer polars. Part of the AlterLab Academic Skills suite./alterlab-edaExploratory data analysis (EDA) on a scientific data file — auto-detects the format, runs structure/quality/statistics checks, and writes a markdown EDA report with downstream recommendations. Use when asked to "explore", "analyze", "summarize", "profile", or "QC" a data file, or to understand its structure/content/quality before deciding what analysis to run. Covers tabular (.csv .tsv .xlsx .parquet), arrays (.npy .npz .hdf5 .h5 .mat .fits), sequence/genomics (.fasta .fastq .sam .bam .vcf .bed .gff .gtf .h5ad), microscopy (.tif .nd2 .czi .lif .ims .dcm .nii), spectroscopy/MS (.mzML .mzXML .mgf .fid .jdx), chemistry (.pdb .cif .mol .sdf .xyz .gro), and proteomics/metabolomics (.pepXML .mzid .mzTab). For zero-shot forecasting of a series use alterlab-timesfm; to create/configure a chunked cloud array store use alterlab-zarr. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job