ols-regression

Estimate OLS regression models with robust standard errors and econometric diagnostics.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill ols-regression-xjtulyc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ols-regression
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/07-economics/ols-regression
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill ols-regression-xjtulyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires statsmodels>=0.14.0, pandas>=2.0.0, numpy>=1.24.0, scipy>=1.10.0, matplotlib>=3.7.0, seaborn>=0.12.0, patsy>=0.5.3.

What problem does it solve?

This Skill helps you perform ordinary least squares regression and avoid misleading inference by running key econometric diagnostics and producing presentation-ready results.

Core Features & Use Cases

  • Full OLS workflow: fit models from a Patsy formula, generate results, and compute fit statistics (N, R², adjusted R², AIC/BIC, F-statistic).
  • Diagnostics for validity: test heteroscedasticity (Breusch–Pagan and White), check functional form misspecification (RESET), assess residual normality, and report Durbin–Watson for autocorrelation signals.
  • Robust inference & reporting: compute HC3 robust standard errors and VIF for multicollinearity, optionally support clustered SE, and generate regression tables suitable for write-ups.
  • Use case: analyze how education and experience relate to log wages while reporting heteroscedasticity-aware standard errors, VIF flags, and diagnostic plots to support an economics-style empirical paper.

Quick Start

Use the ols-regression skill to estimate an OLS model from your dataset and return robust regression results with heteroscedasticity tests, VIF, RESET, and a publication-style summary table.

Frequently Asked Questions about ols-regression

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run OLS regression in Python with robust standard errors and heteroscedasticity tests?

Run OLS regression with robust standard errors by fitting a Patsy formula to a pandas DataFrame, which computes HC3 or clustered covariance and runs Breusch-Pagan and White tests for heteroscedasticity. This ensures reliable econometric inference for empirical analysis.

How do I check multicollinearity and model specification when running OLS regression?

Check multicollinearity and model specification by calculating Variance Inflation Factor (VIF) for predictors and running a RESET test for functional form misspecification. These diagnostics validate the OLS model specification and flag problematic independent variables.

What's the best way to generate publication-ready regression tables from statsmodels?

Generate publication-ready regression tables from statsmodels by estimating OLS models and exporting formatted summary outputs with fit statistics like R-squared, adjusted R-squared, AIC, and BIC. This produces research-paper-quality results with robust standard errors.

Can I use Patsy formulas with a pandas DataFrame to estimate econometric models in statsmodels?

You can use Patsy formulas with a pandas DataFrame to estimate econometric models in statsmodels by defining the dependent and independent variables in a string formula. This requires pandas and statsmodels dependencies to parse the formula and fit the OLS model.

Why do my OLS regression standard errors change when I apply robust covariance adjustments?

OLS regression standard errors change with robust covariance adjustments because HC3 or clustered standard errors correct for heteroscedasticity detected by Breusch-Pagan and White tests. This provides valid inference even when residual variance is not constant.

When should I use clustered standard errors instead of HC3 robust standard errors in OLS regression?

Use clustered standard errors instead of HC3 robust standard errors in OLS regression when data has grouped or panel structures, as clustered covariance accounts for within-group correlation. HC3 is appropriate for general heteroscedasticity without group dependencies.