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.
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
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. 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