Overview
statsmodels provides statistical modeling and econometrics in Python, including linear and generalized linear models, time-series methods, discrete models, robust estimation, and hypothesis testing. It emphasizes inferential outputs such as coefficients, standard errors, confidence intervals, statistical tests, and diagnostics.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Inspect model estimates and statistical inference
OLS, GLS, WLS, GLMs, Logit/Probit, and related models expose coefficient estimates together with standard errors, tests, and confidence intervals.
Sources: [2]
Cover time-series and econometric modeling
ARIMA/ARIMAX, VAR, state-space models, exponential smoothing, unit-root tests, cointegration, and other time-series tools are available in the same package.
Sources: [2]
For analysis where explanation, testing, and diagnostics matter
statsmodels fits workflows that need interpretable effects, formal hypothesis tests, and model diagnostics in addition to or instead of predictive performance.
Do not reduce model quality to statistical significance alone
P-values and fit statistics need to be interpreted alongside assumptions, residual diagnostics, effect size, data-generating context, and external validation. The README also labels sandbox code as not production ready.
Sources: [2]
Official sources
- [1]statsmodels/statsmodels repository(2026-09-20)
- [2]statsmodels README(2026-09-20)
- [3]statsmodels BSD-3-Clause license(2026-09-20)
- [4]statsmodels documentation(2026-09-20)
Supplemental curator note
statsmodels is especially useful when analysis needs coefficient estimates, standard errors, p-values, confidence intervals, and model diagnostics rather than prediction accuracy alone. It complements predictive ML tooling with inferential statistical modeling.
Try it in 3 steps
- 1
Install statsmodels
Install the released package in a virtual environment.
python -m pip install statsmodels - 2
Fit an OLS regression
Fit OLS and inspect a summary that includes coefficients, standard errors, and statistical tests.
python -c "import statsmodels.api as sm; y=[1,2,3,4]; X=sm.add_constant([1,2,3,4]); print(sm.OLS(y,X).fit().summary())" - 3
Inspect inference results
Look beyond predictions and examine coefficient estimates, p-values, and confidence intervals.
Inspect result.params, result.pvalues, result.conf_int()
Growth
Growth trends · Last 30 days
11,635 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 336
- Open PRs
- 178
- Issues opened
- 29
- Issues closed
- 155
- PRs opened
- 377
- PRs merged
- 371
Issues
29 / 155
Pull requests
377 / 371
Maintenance
- Median first response
- 2.8 hr
- Issue response rate
- 37.9% (11/29)
Based on up to the 100 newest issues opened by external users in the last 90 days. A first comment from an OWNER, MEMBER, or COLLABORATOR counts as a response; issues whose full comment history cannot be checked are excluded. The median and response rate update weekly.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- python
- statistics
- econometrics
- data-analysis
- generalized-linear-models
- timeseries-analysis
- regression-models
- count-model
- data-science
- forecasting
- hypothesis-testing
- prediction
- Stars
- 11,635
- Forks
- 3,601
- Watchers
- 287
- Open issues
- 2,644
- Contributors
- 397
- Primary language
- Python
- License
- BSD-3-Clause
- Repository last updated
- Sep 17, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Apache Superset74,847 Stars
An open-source BI platform with no-code charts, SQL Lab, a semantic layer, and broad SQL data-source connectivity.
Python - OpenBB73,262 Stars
An open financial data platform that exposes multiple providers to Python, REST APIs, MCP, analysts, quants, and AI agents.
Python - scikit-learn67,305 Stars
A Python ML library unifying preprocessing, classification, regression, clustering, model selection, and evaluation.
Python - pandas49,751 Stars
A Python DataFrame library for missing values, joins, aggregation, reshaping, time series, and tabular I/O.
Python - Streamlit45,795 Stars
A framework that turns Python scripts into interactive data apps with widgets, dataframes, and charts.
Python
Report incorrect information
Tell us if any listing information is incorrect or outdated.