Claude Code Statsmodels Skill for OLS Intercepts and Residuals
Prepare a response and predictor, fit ordinary least squares, and interpret coefficients and residuals. Begin with a known toy dataset to check setup.
中文Install in Claude Code
Use Claude Code with the complete pinned skill and a Python environment with Statsmodels.
- Get the complete `cli-tool/components/skills/scientific/statsmodels` directory from the pinned GitHub checkout.
- Copy it under the target project's `.claude/skills/`. Confirm `.claude/skills/statsmodels/SKILL.md`, open Claude Code at the project root, and call `/statsmodels`.
Example task
Fit an OLS line with intercept to x values 0, 1, 2, 3 and y values 2, 5, 8, 11. Explain how omitting the intercept would change the model.What to check
The fitted intercept is 2, slope is 3, and residuals are near zero. Treat this toy example as an implementation check.
Original SKILL.md on GitHub · Updated
Frequently asked question
Why verify that an intercept is included?
It defines the baseline at x equal to zero. When using a design matrix, check that the constant column or constraint matches the intended model.