Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
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 Is the Breusch-Pagan Test?
The Breusch-Pagan test is a hypothesis test for heteroscedasticity in a regression. It regresses the squared residuals on the predictors and tests, with a chi-square statistic, whether the error variance depends on them. The null hypothesis is constant variance (homoscedasticity); a small p-value, such as below 0.05, means the standard errors from ordinary least squares cannot be trusted and robust ones are needed.
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.
- Fit the original regression (the one whose standard errors you actually care about) and save its residuals.
- Square each residual.
- 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).
- Take the R² from that auxiliary regression and compute the test statistic LM = n × R², where n is the sample size.
- 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 (see HC0 to HC3 robust standard errors) 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
robustoption). - 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.
Which HC Estimator in Practice
In R, the sandwich package function vcovHC() uses type HC3 by default, following the simulation evidence of Long and Ervin (2000, The American Statistician 54:217-224) on HC0 to HC3. HC0 is White’s 1980 estimator (Econometrica 48:817-838). HC4 (Cribari-Neto 2004, Computational Statistics & Data Analysis 45:215-233), HC5 (Cribari-Neto, Souza and Vasconcellos 2007, Communications in Statistics: Theory and Methods 36:1877-1888) and HC4m (Cribari-Neto and Da Silva 2011, AStA 95(2):129-146) are further variants that account for high-leverage observations. The data table below lists each option with its reference (sandwich vcovHC reference). When the data contain a few high-leverage points, check them first with Cook’s distance before choosing among these.
Small Samples: LM Versus F
The statsmodels function returns two versions of the same test: the LM statistic (n × R², compared with a chi-square distribution) and an F statistic from the auxiliary regression. The statsmodels documentation states that the LM test can exaggerate significance in small or moderately large samples, so the F statistic is preferred there. The worked example above shows why this matters. With an auxiliary R² of 0.9565, LM = 6 × 0.9565 ≈ 5.74 and the chi-square p-value with 1 degree of freedom is about .017. The F form, F = R² / (1 − R²) × (n − 2) with 1 and 4 degrees of freedom, comes to about 87.9. Both reject the null in this contrived case, but the two statistics are on different scales and use different reference distributions, so report which one you used.
Testing Against Chosen Variables
By default the auxiliary regression uses the same predictors as the model. Both main implementations let you narrow that. In R, lmtest::bptest() takes a varformula argument: a formula for the variables that are allowed to drive the variance, defaulting to the model’s own regressors. Its degrees of freedom equal the number of regressors in the variance model excluding the constant, and studentize = TRUE (the default) gives Koenker’s version; studentize = FALSE gives the original Breusch-Pagan statistic (lmtest reference). In statsmodels, the second argument, exog_het, holds the variables for the variance model and must include a constant. Testing a single suspected driver, such as dosage in the example, spends only one degree of freedom and so keeps more power than testing every predictor at once.
Running the Test in Code
R, with the variance tested against one variable and Koenker’s version:
library(lmtest)
fit <- lm(y ~ x1 + x2, data = d)
bptest(fit, varformula = ~ x1, studentize = TRUE, data = d)
Python, using the fitted model’s residuals and design matrix (which already contains the constant):
import statsmodels.api as sm
from statsmodels.stats.diagnostic import het_breuschpagan
model = sm.OLS(y, sm.add_constant(X)).fit()
lm, lm_p, f, f_p = het_breuschpagan(model.resid, model.model.exog)
The function returns the LM statistic, its p-value, the F statistic and its p-value. Setting robust=False switches to the original 1979 form, which assumes normally distributed residuals; the default robust=True is Koenker’s version. The companion function het_white(resid, exog) runs White’s test and adds squares and, by default, interaction terms itself (statsmodels het_white).
Limits of the Test
- Linear variance only. The auxiliary regression is linear in the variables supplied, so a variance that rises and then falls can pass the test while the residual plot shows an obvious pattern.
- A non-significant result is not proof of constant variance. Power is low in small samples.
- It detects variance patterns, not misspecification. A missing squared term in the mean function can leave residuals that look heteroscedastic.
What to Report
- Which version of the test was run (Koenker’s studentized form or the original) and in which software.
- The test statistic (LM or F), its degrees of freedom and the p-value.
- Which variables were tested (all predictors or a chosen subset).
- Which standard-error estimator was used afterwards (for example HC3) and that coefficients are unchanged.
How to Interpret Breusch-Pagan Test Results
The test asks one question: does the variance of the errors depend on the variables in the auxiliary regression? Its hypotheses and decision rule are short, but the wording of the conclusion matters.
| Element | What it says |
|---|---|
| Null hypothesis | Homoscedasticity: the slope coefficients in the variance model are all zero, so error variance does not depend on the predictors |
| Alternative hypothesis | Heteroscedasticity: the error variance changes with at least one of the variables tested |
| Small p-value (for example, below .05) | Reject the null; treat the standard errors as unreliable and report robust (HC) ones |
| Large p-value | Fail to reject; no evidence of this kind of heteroscedasticity, which is not proof that variance is constant |
Two versions of the statistic are in circulation. The original 1979 version works from the scaled squared residuals and assumes normally distributed errors. Koenker’s variant uses the raw squared residuals and the statistic nR², and it is robust to non-normal errors; see the Wikipedia overview of the test. In Python’s statsmodels, het_breuschpagan uses the Koenker version by default (robust=True) and returns both an LM statistic and an F statistic; the statsmodels documentation notes that the LM test can overstate significance in small or moderately large samples and recommends the F statistic there. For a step-by-step R walkthrough, see running bptest in R, and for the concept itself, what homoscedasticity means.
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)(thelmtestpackage), which runs Koenker’s studentized version by default. - Stata:
estat hettestafterregress(add the, rhsoption 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 thestatsmodelspackage, 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 is the Breusch-Pagan test formula?
In the studentized (Koenker) form, square the OLS residuals, regress them on the predictors, and compute LM = n × R² from that auxiliary regression. Under the null of homoscedasticity, LM follows a chi-square distribution with degrees of freedom equal to the number of predictors in the auxiliary regression (excluding the intercept).
What is the null hypothesis of the Breusch-Pagan test?
The null hypothesis is homoscedasticity: the error variance is constant and does not depend on the predictors. Rejecting it means the variance changes with at least one of them.
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.
What is the difference between Breusch-Pagan and Koenker’s version?
The original 1979 test assumes normally distributed errors. Koenker’s 1981 studentized version (Journal of Econometrics 17:107-112) does not, and is the default in R’s bptest (studentize = TRUE) and in statsmodels (robust=True).
Should I use the LM or F statistic from statsmodels?
The statsmodels documentation says the LM test can exaggerate significance in small or moderately large samples, so use the F statistic there and state which you report.
Can the Breusch-Pagan test examine a single variable?
Yes. Use varformula in R’s bptest or pass only that variable (plus a constant) as exog_het in statsmodels.
Which HC robust standard error should I use?
The sandwich default is HC3, supported by Long and Ervin’s simulations. HC4, HC5 and HC4m target data with high-leverage points. Name the type you used.
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.
Sources
- statsmodels het_breuschpagan
- statsmodels het_white
- lmtest bptest reference
- sandwich vcovHC reference
- Breusch, T. S. and Pagan, A. R. (1979), Econometrica 47:1287-1294; Koenker, R. (1981), Journal of Econometrics 17:107-112
Data: Heteroscedasticity test and robust standard error options in R (lmtest, sandwich) and Python (statsmodels)
Compares the Breusch-Pagan and HC-estimator options exposed by lmtest, sandwich and statsmodels: package, argument that selects the variant, default and original reference. Compiled from the package reference documentation for each function.
Period covered: 1979/2011.
| Method / option | Software | Kind | Setting or default | Original reference | Reference year (year) |
|---|---|---|---|---|---|
| Breusch-Pagan, studentized (Koenker) | R lmtest::bptest | test | studentize = TRUE (default); chi-square, df = regressors excluding constant | Koenker, J. Econometrics 17:107-112 | 1981 |
| Breusch-Pagan, original | R lmtest::bptest | test | studentize = FALSE | Breusch & Pagan, Econometrica 47:1287-1294 | 1979 |
| Breusch-Pagan, studentized (Koenker) | Python statsmodels het_breuschpagan | test | robust = True (default); returns lm, lm_pvalue, fvalue, f_pvalue | Koenker, J. Econometrics 17:107-112 | 1981 |
| Breusch-Pagan, original | Python statsmodels het_breuschpagan | test | robust = False (assumes normal residuals) | Breusch & Pagan, Econometrica 47:1287-1294 | 1979 |
| HC0 (White) | R sandwich::vcovHC | estimator | type = "HC0" | White, Econometrica 48:817-838 | 1980 |
| HC3 | R sandwich::vcovHC | estimator | type = "HC3" (default) | Long & Ervin, Am. Stat. 54:217-224 | 2000 |
| HC4 | R sandwich::vcovHC | estimator | type = "HC4" (leverage-adjusted) | Cribari-Neto, CSDA 45:215-233 | 2004 |
| HC5 | R sandwich::vcovHC | estimator | type = "HC5" (leverage-adjusted) | Cribari-Neto, Souza & Vasconcellos, Commun. Stat. Theory Methods 36:1877-1888 | 2007 |
| HC4m | R sandwich::vcovHC | estimator | type = "HC4m" (modified HC4) | Cribari-Neto & Da Silva, AStA 95(2):129-146 | 2011 |
Sources
- statsmodels het_breuschpagan (accessed 2026-11-18)
- lmtest bptest reference (accessed 2026-11-18)
- sandwich vcovHC reference (accessed 2026-11-18)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







