Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Fits and diagnoses statistical models in Python, covering regression, GLMs, discrete outcomes, time series, and hypothesis tests.
92% 100%+8 ptsof test cases passed
Passed 24 of 24 test cases with the skill, and 22 of 24 without it.
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
This file contains the detailed procedure and reference material extracted from
SKILL.mdfor focused loading. The root skill defines activation, examples, safety constraints, and limitations.
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.
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}")
# Predictions with confidence intervals
predictions = results.get_prediction(X_new)
pred_summary = predictions.summary_frame()
print(pred_summary) # includes mean, CI, prediction intervals
# Diagnostics
from statsmodels.stats.diagnostic import het_breuschpagan
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.