K-Dense-AI/scientific-agent-skills / skills/statsmodels
statsmodels
VerifiedFits and diagnoses Python statistical models including OLS, GLM, discrete and mixed models, ARIMA and SARIMAX. Supports coefficient inference, marginal effects, model comparison and time series forecasting with explicit design and uncertainty checks. Used for econometrics and statistical modeling; for guided test selection with APA reporting, see statistical-analysis.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.4 KB |
| references/discrete_choice.md | markdown | 18.3 KB |
| references/glm.md | markdown | 18.0 KB |
| references/linear_models.md | markdown | 13.7 KB |
| references/model_selection.md | markdown | 3.4 KB |
| references/modeling_capabilities.md | markdown | 6.1 KB |
| references/quick_start_guide.md | markdown | 4.7 KB |
| references/review.md | markdown | 6.9 KB |
| references/stats_diagnostics.md | markdown | 23.5 KB |
| references/time_series.md | markdown | 21.3 KB |
references/modeling_capabilities.md
View on GitHub# Core Statistical Modeling Capabilities
Linear models, generalized linear models, discrete choice models, time series analysis,
and statistical tests and diagnostics — what statsmodels offers in each area and which
class to use.
## Core Statistical Modeling Capabilities
### 1. Linear Regression Models
Comprehensive suite of linear models for continuous outcomes with various error structures.
**Available models:**
- **OLS**: Standard linear regression with i.i.d. errors
- **WLS**: Weighted least squares for heteroskedastic errors
- **GLS**: Generalized least squares for arbitrary covariance structure
- **GLSAR**: GLS with autoregressive errors for time series
- **Quantile Regression**: Conditional quantiles (median fits reduce response-outlier sensitivity, not high-leverage bias)
- **Mixed Effects**: Hierarchical/multilevel models with random effects
- **Recursive/Rolling**: Expanding-window or rolling-window coefficient estimates
**Key features:**
- Comprehensive diagnostic tests
- Robust standard errors (HC, HAC, cluster-robust)
- Influence statistics (Cook's distance, leverage, DFFITS)
- Hypothesis testing (F-tests, Wald tests)
- Model comparison (AIC, BIC, likelihood ratio tests)
- Prediction with confidence and prediction intervals
**When to use:** Continuous outcome variable, want inference on coefficients, need diagnostics
**Reference:** See `references/linear_models.md` for detailed guidance on model selection, diagnostics, and best practices.
### 2. Generalized Linear Models (GLM)
Flexible framework extending linear models to non-normal distributions.
**Distribution families:**
- **Binomial**: Binary outcomes or proportions (logistic regression)
- **Poisson**: Count data
- **Negative Binomial**: Overdispersed counts
- **Gamma**: Positive continuous, right-skewed data
- **Inverse Gaussian**: Positive continuous with specific variance structure
- **Gaussian**: Identity link with unweighted independent errors reproduces OLS coefficients
- **Tweedie**: Flexible family for semi-continuous data
**Link functions:**
- Logit, Probit, Log, Identity, Inverse, Sqrt, CLogLog, Power
- Choose based on interpretation needs and model fit
**Key features:**
- Maximum likelihood estimation via IRLS
- Deviance and Pearson residuals
- Goodness-of-fit statistics
- Pseudo R-squared measures
- Robust standard errors
**When to use:** A response mechanism and conditional mean/variance structure call for a GLM family and link. Marginal non-normality alone is not the criterion.
**Reference:** See `references/glm.md` for family selection, link functions, interpretation, and diagnostics.
### 3. Discrete Choice Models
Models for categorical and count outcomes.
**Binary models:**
- **Logit**: Logistic regression (odds ratios)
- **Probit**: Probit regression (normal distribution)
**Multinomial models:**
- **MNLogit**: Unordered categories (3+ levels)
- **Conditional Logit**: Group-conditioned binary likelihood with no explicit intercept; choice sets define groups
- **Ordered Model**: Ordinal outcomes (ordered categories)
**Count models:**
- **Poisson**: Standard count model
- **Negative Binomial**: Overdispersed counts
- **Zero-Inflated**: Excess zeros (ZIP, ZINB)
- **Hurdle Models**: Two-stage models for zero-heavy data
**Key features:**
- Maximum likelihood estimation
- Marginal effects at means or average marginal effects
- Model comparison via AIC/BIC
- Predicted probabilities and classification
- Goodness-of-fit tests
**When to use:** Binary, categorical, or count outcomes
**Reference:** See `references/discrete_choice.md` for model selection, interpretation, and evaluation.
### 4. Time Series Analysis
Comprehensive time series modeling and forecasting capabilities.
**Univariate models:**
- **AutoReg (AR)**: Autoregressive models
- **ARIMA**: Autoregressive integrated moving average
- **SARIMAX**: Seasonal ARIMA with exogenous variables
- **Exponential Smoothing**: Simple, Holt, Holt-Winters
- **ETS**: Innovations state space models
**Multivariate models:**
- **VAR**: Vector autoregression
- **VARMAX**: VAR with MA and exogenous variables
- **Dynamic Factor Models**: Extract common factors
- **VECM**: Vector error correction models (cointegration)
**Advanced models:**
- **State Space**: Kalman filtering, custom specifications
- **Regime Switching**: Markov switching models
- **ARDL**: Autoregressive distributed lag
**Key features:**
- ACF/PACF analysis for model identification
- Stationarity tests (ADF, KPSS)
- Forecasting with prediction intervals
- Residual diagnostics (Ljung-Box, heteroskedasticity)
- Granger causality testing
- Impulse response functions (IRF)
- Forecast error variance decomposition (FEVD)
**When to use:** Time-ordered data, forecasting, understanding temporal dynamics
**Reference:** See `references/time_series.md` for model selection, diagnostics, and forecasting methods.
### 5. Statistical Tests and Diagnostics
Extensive testing and diagnostic capabilities for model validation.
**Residual diagnostics:**
- Autocorrelation tests (Ljung-Box, Durbin-Watson, Breusch-Godfrey)
- Heteroskedasticity tests (Breusch-Pagan, White, ARCH)
- Normality tests (Jarque-Bera, Omnibus, Anderson-Darling, Lilliefors)
- Specification tests (RESET, Harvey-Collier)
**Influence and outliers:**
- Leverage (hat values)
- Cook's distance
- DFFITS and DFBETAs
- Studentized residuals
- Influence plots
**Hypothesis testing:**
- t-tests (one-sample, two-sample, paired)
- Proportion tests
- Chi-square tests
- Non-parametric tests (Mann-Whitney, Wilcoxon, Kruskal-Wallis)
- ANOVA (one-way, two-way, repeated measures)
**Multiple comparisons:**
- Tukey's HSD
- Bonferroni correction
- False Discovery Rate (FDR)
**Effect sizes and power:**
- Cohen's d, eta-squared
- Power analysis for t-tests, proportions
- Sample size calculations
**Robust inference:**
- Heteroskedasticity-consistent SEs (HC0-HC3)
- HAC standard errors (Newey-West)
- Cluster-robust standard errors
**When to use:** Investigating assumptions and sensitivity. Diagnostic test non-rejection and robust standard errors do not establish scientific validity.
**Reference:** See `references/stats_diagnostics.md` for comprehensive testing and diagnostic procedures.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |