Skip to main content
v2026.11,610 entries · CC-BY 4.0

Breusch-Pagan Test for Heteroscedasticity: Logic, Worked Example, and the Robust-SE Fix

The Breusch-Pagan test’s logic — regressing squared residuals on the predictors — a worked numeric example, and why heteroscedasticity-consistent standard errors, not a transformation, are the routine fix once it’s confirmed.

Ask about Breusch-Pagan Test for Heteroscedasticity: Logic, Worked Example, and the Robust-SE Fix

Answers are drawn from this guide and the rest of the CASRAI corpus, with a link to every source.

Answers are AI-generated from CASRAI’s own published pages and can be wrong, so check the linked sources before relying on one; your question is logged without personal data — never sold, never used to train a third-party model — to show us what CASRAI is missing, so please do not type personal or confidential details. How we use this

Written and maintained by CASRAI Editorial Board

Last updated

The Breusch-Pagan test does not tell you whether your regression model is wrong — it tells you whether the standard errors attached to its coefficients can be trusted. Ordinary least squares (OLS) assumes the variance of the error term is constant across all values of the predictors (homoscedasticity). When that variance instead grows or shrinks systematically — residuals that fan out as fitted values increase is the classic pattern — the coefficient estimates themselves usually stay unbiased, but the formula OLS uses to compute their standard errors is built on the constant-variance assumption and produces the wrong answer once it’s violated. The Breusch-Pagan test is the standard formal check for this: instead of eyeballing a residual plot and judging whether the funnel looks convincing, it regresses the squared residuals on the predictors and asks, with an actual test statistic and p-value, whether that relationship is real.

What Heteroscedasticity Actually Breaks

It’s worth being precise about which part of a regression output heteroscedasticity touches, because it’s easy to either overreact or underreact to a positive test result.

  • It does not bias the coefficients. Given a correctly specified mean function, OLS coefficient estimates stay unbiased and consistent whether or not the error variance is constant — heteroscedasticity is a statement about the spread of the errors, not their average.
  • It does bias the standard errors, and therefore everything downstream of them. The conventional OLS standard-error formula assumes a single, constant error variance. When the true variance instead depends on the predictors, that formula is wrong — usually too small in the common case where variance increases with the fitted value — which inflates t-statistics, narrows confidence intervals, and makes p-values look more convincing than the data support.
  • It does not mean the model should be discarded. A significant Breusch-Pagan result is a flag to change how you compute uncertainty around the coefficients, not evidence that the relationship you’ve modeled is spurious.

See Regression Analysis: Assumptions, Interpretation, and How to Report It for where homoscedasticity sits among OLS’s other assumptions, and the Durbin-Watson test for the parallel case with autocorrelated (rather than heteroscedastic) residuals — a different assumption, the same kind of standard-error damage.

The Breusch-Pagan Test’s Logic: Regressing Squared Residuals on the Predictors

The test’s mechanics follow directly from what heteroscedasticity actually is: variance that depends systematically on the predictors. Since the squared residuals from a regression are the sample’s best available proxy for that variance at each observation, the test checks for a relationship the direct way — by regressing them on the same predictors and seeing whether that regression explains a meaningful share of the variation.

  1. Fit the original regression (the one whose standard errors you actually care about) and save its residuals.
  2. Square each residual.
  3. Run a second, auxiliary regression of the squared residuals on the original model’s predictors (Breusch and Pagan’s 1979 Econometrica paper, “A Simple Test for Heteroskedasticity and Random Coefficient Variation,” is the origin of the test).
  4. Take the R² from that auxiliary regression and compute the test statistic LM = n × R², where n is the sample size.
  5. Compare LM to a chi-square distribution with k degrees of freedom, where k is the number of predictors in the auxiliary regression (excluding the intercept).

The null hypothesis is homoscedasticity — that the squared residuals are unrelated to the predictors, so the auxiliary regression should explain essentially none of their variation and R² should sit near zero. A large LM statistic (equivalently, a small p-value) rejects that null and concludes the error variance does depend on the predictors. This nR² form is Roger Koenker’s studentized version of the original test, which relaxed Breusch and Pagan’s assumption that the errors are normally distributed — it’s what most statistical software actually runs by default when you call “the” Breusch-Pagan test today.

Worked Example: Testing the Same Funnel-Shaped Residuals

Illustrative example, not drawn from any specific published study — the same six-observation dataset used in How to Read a Residual Plot, carried through the actual test rather than just the visual check. A regression of reaction time (ms) on drug dosage (mg) produced these residuals:

Dosage (mg) Residual (ms) Squared residual
5 −3 9
10 +5 25
20 −8 64
40 +15 225
80 −28 784
160 +52 2,704

Regressing that squared-residual column on dosage (the auxiliary regression in step 3 above) produces an R² of roughly 0.96 — dosage explains almost all of the variation in squared residuals, which is exactly what a growing funnel looks like in this framework. With n = 6, that gives:

LM = n × R² = 6 × 0.96 ≈ 5.7

Compared to a chi-square distribution with 1 degree of freedom (one predictor, dosage), a statistic of 5.7 corresponds to a p-value of roughly 0.02 — below the conventional 0.05 threshold, so the null of homoscedasticity is rejected. The correct write-up: “A Breusch-Pagan test confirmed the heteroscedasticity suggested by the residual plot (LM = 5.7, df = 1, p ≈ .02); heteroscedasticity-consistent standard errors are reported accordingly.” Six observations is far too small a sample for the chi-square approximation to be reliable in practice — this walk-through is sized to show the arithmetic clearly, not as a template for real inference on a dataset that small.

The Test vs. the Plot: Why You Need Both, Not Either

A residual-vs-fitted plot and the Breusch-Pagan test answer different questions, and neither substitutes for the other:

  • The plot shows you where and what shape. A funnel that widens at high fitted values calls for a different fix than one that’s widest in the middle, or one that’s tied to a specific predictor rather than the fitted value generally. Only the plot surfaces that.
  • The test tells you whether it’s real, with a number attached. A residual plot is read by eye, and “some” funneling is genuinely ambiguous in a small or noisy sample — two researchers can look at the same plot and disagree. The test converts that judgment call into a statistic and a p-value, which is what actually belongs in a methods section.
  • The test can miss what the plot catches, and vice versa. Breusch-Pagan assumes the variance relationship is linear in the predictors; a plot can reveal a nonlinear or localized pattern the test’s linear auxiliary regression isn’t built to detect. Conversely, a plot on a small sample can look patternless while the test still finds a significant relationship, or look alarming while the test doesn’t reach significance.

The practical rule: use the plot to build intuition about the shape of the problem, and report the test statistic — not a description of the plot — as the actual evidence in a methods section.

The Fix: Heteroscedasticity-Consistent (Robust) Standard Errors

Once heteroscedasticity is confirmed, the routine fix in applied regression work is not to transform the outcome variable or throw out the model — it’s to recompute the standard errors with an estimator that doesn’t assume constant variance in the first place. These are commonly called heteroscedasticity-consistent (HC) standard errors, robust standard errors, or the White sandwich estimator, after Halbert White’s 1980 paper that introduced the approach. The coefficients themselves are unchanged; only the standard errors, confidence intervals, and p-values built from them are recalculated using an estimator that lets the variance differ across observations.

Several variants exist, differing in how they adjust for small-sample bias:

  • HC0 — White’s original estimator; asymptotically valid but tends to understate standard errors in smaller samples.
  • HC1 — HC0 with a degrees-of-freedom correction; a common default in econometrics software (e.g., Stata’s robust option).
  • HC2 / HC3 — further corrections that weight each observation’s contribution by its leverage; HC3 is generally the most conservative and is widely recommended as the default choice for smaller samples or when influential/high-leverage points are present.

Robust standard errors are the practical default fix specifically because they require no change to the model specification and no assumption about what’s driving the heteroscedasticity. A variance-stabilizing transformation of the outcome (a log transform is the common case) is a legitimate alternative when the heteroscedasticity is severe or when the transformation also serves an independent modeling purpose, but it changes what the coefficients mean and isn’t necessary just to fix inference. See Multicollinearity and VIF in Regression and Endogeneity: The Three Sources, and the Remedy That Matches Each for the other two assumption violations that routinely get diagnosed alongside heteroscedasticity in a regression write-up.

Breusch-Pagan vs. White’s Test

  Breusch-Pagan White’s test
Auxiliary regression uses The original predictors (linear terms) The original predictors plus their squares and cross-products
What it can detect Variance that’s a linear function of the predictors Variance following a broader class of nonlinear relationships
Degrees of freedom Smaller (fewer terms in the auxiliary regression) Larger, which costs power in small samples
Typical use Default first check; more powerful when the simpler linear form is a reasonable guess Follow-up when Breusch-Pagan is negative but a nonlinear pattern is plausible, or with few predictors so the extra terms stay manageable

In practice the two rarely disagree by much when there’s only one or two predictors; White’s test earns its keep mainly in multi-predictor models where the source of heteroscedasticity isn’t obviously linear in any single variable.

Running the Test in R, Stata, and Python

  • R: lmtest::bptest(model) (the lmtest package), which runs Koenker’s studentized version by default.
  • Stata: estat hettest after regress (add the , rhs option to use the right-hand-side predictors rather than the fitted values in the auxiliary regression).
  • Python: statsmodels.stats.diagnostic.het_breuschpagan(residuals, exog) from the statsmodels package, which returns the LM statistic and its p-value directly.

All three report the LM statistic and p-value described above; none of them requires you to build the auxiliary regression by hand, but understanding it (as walked through above) is what lets you read the output correctly instead of treating it as a black box.

Frequently Asked Questions

What does a significant Breusch-Pagan result actually mean for my regression?

It means the standard errors, confidence intervals, and p-values reported by a default OLS fit are unreliable — not that the coefficients are wrong or the model is misspecified. The fix is switching to heteroscedasticity-consistent standard errors, not re-specifying the model, unless a plot or theory also points to a missing term.

Do I need to check the residual plot if I’m already running the formal test?

Yes. The test gives you a statistic and a p-value; the plot tells you what kind of heteroscedasticity you have and whether the test’s linear auxiliary-regression assumption is even a reasonable way to model it. Reporting the test without ever having looked at the plot risks missing a nonlinear or localized pattern the test isn’t built to catch. See How to Read a Residual Plot.

Should I use robust standard errors by default, even when the Breusch-Pagan test isn’t significant?

Some applied researchers do, on the reasoning that HC3 standard errors converge to the conventional ones when the data are actually homoscedastic, so there’s little cost to using them routinely. Others prefer to test first and only switch estimators when there’s evidence to justify it, so the choice is documented rather than automatic. Both are defensible; what matters is stating in the methods section which standard errors were used and why.

Does a non-significant Breusch-Pagan test prove homoscedasticity?

No — it fails to reject the null, which is not the same as confirming it, and the test has limited power in small samples. A non-significant result alongside a residual plot that still shows a visible pattern is a reason to look more closely, not to conclude the assumption is satisfied.

For where this fits among the other regression diagnostics researchers are expected to run and report, see the Research Methods & Statistics hub, and Cook’s Distance and Influential Observations for the related question of whether a handful of high-leverage points, rather than genuine heteroscedasticity, are driving the pattern.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Regulatory Radar

Stop finding out after the fact

$29/month, cancel anytime. Daily digest updates from our analysis, a dashboard holding the same items, and a cited assistant for everything they raise.

  • Federal Register, Federal Register+, Grants.gov, Regulations.gov, NSF News, UKRI, plus CASRAI’s own published content.
  • 44,322 indexed passages, and every answer cites the ones it drew on.