statsmodels

Solid

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.

AI & Automation 26,817 stars 2774 forks Updated today MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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) ```python import statsmodels.api as sm import numpy as np import pandas as pd # Prepare data - ALWAYS add constant for intercept X = sm.add_constant(X_data) # Fit OLS model model = sm.OLS(y, X) results = model.fit() # View comprehensive results print(results.summary()) # Key results print(f"R-squared: {results.rsquared:.4f}") print(f"Coefficients:\\n{results.params}") print(f"P-values:\\n{results.pvalues}") # Predi...

Details

Author
K-Dense-AI
Repository
K-Dense-AI/scientific-agent-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category