When you need actual statistical inference with p-values, confidence intervals, and diagnostic tests rather than just predictions, this is your tool. It handles the full spectrum from OLS and logistic regression to ARIMA time series and GLMs with proper hypothesis testing, AIC/BIC model comparison, and publication-ready summary tables. The library can feel academic compared to scikit-learn, but that's the point. You get residual diagnostics, heteroskedasticity tests, marginal effects, and all the econometric rigor that sklearn deliberately leaves out. One gotcha: you must manually add a constant with sm.add_constant() or your intercept will be zero, which trips up newcomers constantly.

skills.sh installs
426
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill statsmodels --agent claude-code

Installs into .claude/skills of the current project.

Files

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)

import statsmodels.api as sm
import numpy as np
import pandas as pd

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Category
Data Science & ML
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1syncfusion avatarsyncfusion-blazor-chartssyncfusion/blazor-ui-components-skillsImplement Syncfusion Blazor Chart (SfChart) component for comprehensive data visualization. Use this when creating line charts, bar/column charts, area charts, 411skills.sh installs
2davila7 avatargeopandasdavila7/claude-code-templatesPython library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial an407skills.sh installs
3davila7 avatarvenue-templatesdavila7/claude-code-templatesAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, A393skills.sh installs
4mims-harvard avatardevtu-optimize-skillsmims-harvard/tooluniverseOptimize ToolUniverse skills for better report quality, evidence handling, and user experience. Apply patterns like tool verification, foundation data layers, d393skills.sh installs
5galaxy-dawn avatararchitecture-designgalaxy-dawn/claude-scholarUse only when creating new registrable ML components that require Factory or Registry patterns.387skills.sh installs
6davila7 avatarpeft-fine-tuningdavila7/claude-code-templatesParameter-efficient fine-tuning for LLMs using LoRA, QLoRA, and 25+ methods. Use when fine-tuning large models (7B-70B) with limited GPU memory, when you need t378skills.sh installs