statsmodels

Fit, diagnose, and interpret statistical models with statsmodels in Python.

48|6|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/qinyan-ai/qinyan-academic-skills --skill statsmodels-qinyan-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: statsmodels
Source: https://github.com/qinyan-ai/qinyan-academic-skills/tree/main/skills/11-%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E4%B8%8E%E7%BB%9F%E8%AE%A1%E5%BB%BA%E6%A8%A1/statsmodels
Command: npx skills add https://github.com/qinyan-ai/qinyan-academic-skills --skill statsmodels-qinyan-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Statistical modeling and inference across a broad spectrum of methods is essential for rigorous data analysis. Statsmodels provides a comprehensive Python library to fit, diagnose, and interpret statistical models, enabling researchers to move from data to insight with confidence.

Core Features & Use Cases

  • OLS, WLS, GLS, GLM, Quantile Regression, and Mixed Effects for flexible regression and inference.
  • Time-series analysis with ARIMA, SARIMAX, VAR, Exponential Smoothing, and state-space models, plus forecasting and diagnostics.
  • Discrete choice and count models including Logit/Probit, MNLogit, Poisson, Negative Binomial, Zero-Inflated and Hurdle models, with margins and predictions.
  • Comprehensive diagnostics, robust standard errors, model selection via AIC/BIC, influence metrics, and formula/API support for fast modeling.
  • Use Case: A researcher analyzes marketing spend effects on sales using GLM and ARIMA, with diagnostic checks and forecasts.

Quick Start

Install statsmodels and load your data, then fit a basic model to get initial results.

Frequently Asked Questions about statsmodels

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform time-series forecasting and diagnostics with ARIMA or SARIMAX?

Time-series forecasting and diagnostics are handled by fitting ARIMA, SARIMAX, VAR, or state-space models to your data. The workflow provides forecasting outputs and comprehensive diagnostic tests to validate model assumptions.

Can I use robust standard errors and model selection criteria for generalized linear models?

Yes, generalized linear models support robust standard errors and model selection via AIC/BIC. You can fit GLM families, run comprehensive diagnostics, and generate summary outputs to compare and interpret your models.

What is the best way to fit discrete choice and count models like Logit or Poisson?

To fit discrete choice and count models, apply Logit, Probit, Poisson, or Negative Binomial distributions. The library provides margins, predictions, and support for Zero-Inflated and Hurdle models for comprehensive analysis.

Does this statistical modeling approach work for mixed-effects and longitudinal data analysis?

Yes, mixed-effects models are supported for analyzing longitudinal and hierarchical data. You can fit these models, apply diagnostic tests, and generate summary reports to interpret fixed and random effects across various research fields.

How do I diagnose linear regression assumptions using OLS, WLS, and GLS?

Diagnosing linear regression assumptions involves fitting OLS, WLS, or GLS models and applying comprehensive diagnostics. The library provides influence metrics and robust standard errors to evaluate model validity and detect outliers.