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.

Category

Other Tools

Install

Hot:11

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-scientific-skills-statsmodels&locale=en&source=copy

Statsmodels - Python statistical modeling and econometrics analysis tool

Overview

Statsmodels is a professional Python library for statistical modeling, providing a complete statistical toolkit from linear regression and generalized linear models to time series analysis. It is suitable for econometrics, time series analysis, and academic research scenarios that require rigorous statistical inference and model diagnostics.

Use cases

  • Econometrics and economic data analysis

  • Suitable for economic data analysis that requires rigorous statistical inference, including OLS/WLS/GLS regression, instrumental variables estimation, panel data models, etc., and provides complete coefficient tables, standard errors, t-tests, and other statistical inference outputs.

  • Time series analysis and forecasting

  • Supports time series models such as ARIMA, SARIMAX, and VAR, and provides a complete time series modeling workflow with stationarity tests, ACF/PACF analysis, and forecast interval computation.

  • Statistical modeling and hypothesis testing

  • Covers generalized linear models (Logistic, Poisson, Gamma, etc.), discrete choice models, mixed effects models, as well as various residual diagnostics, heteroskedasticity tests, normality tests, and other statistical tests.

    Core features

  • Comprehensive family of regression models

  • Supports linear models such as OLS, WLS, GLS, and quantile regression, as well as generalized linear models like Logit/Probit, Poisson, and negative binomial. It provides model assumption tests, influence point identification, robust standard errors, and other diagnostic functions.

  • Time series modeling and forecasting

  • Includes univariate and multivariate time series models such as ARIMA, SARIMAX, VAR, and exponential smoothing. Supports stationarity tests, Granger causality tests, impulse response analysis, and provides forecasts with confidence intervals.

  • Statistical tests and diagnostic tools

  • Provides residual diagnostics (heteroskedasticity, autocorrelation, normality tests), influence analysis (Cook’s distance, leverage), multiple comparison correction, power analysis, and a full set of statistical validation tools.

    Frequently asked questions

    What's the difference between Statsmodels and scikit-learn? Which should I choose?

    Statsmodels focuses on statistical inference and model interpretation, outputting full statistical tables (coefficients, standard errors, p-values, confidence intervals), and is suited for academic research and scenarios where understanding variable relationships is important. scikit-learn focuses on predictive performance and machine learning workflows, offering a wider range of models and engineering tools. If your goal is to understand relationships between variables and perform rigorous statistical tests, choose Statsmodels; if your goal is to build predictive models, choose scikit-learn.

    How do I perform linear regression with Statsmodels?

    Fit a model using sm.OLS(y, X) and be sure to add an intercept term first with sm.add_constant(X). After fitting, call the fit() method to get results and summary() to view the full statistical table. Use get_prediction() to obtain predictions with confidence intervals, and access residuals for diagnostics via results.resid.

    Which statistical models does Statsmodels support?

    Statsmodels supports a wide range of statistical models: linear models (OLS, WLS, GLS, quantile regression), generalized linear models (Logistic, Poisson, Gamma, negative binomial), discrete choice models (Logit, Probit, multinomial Logit), time series models (ARIMA, SARIMAX, VAR, exponential smoothing), mixed effects models, and various statistical tests and diagnostic tools.