Why Use a Formal Test for Unequal Variance?
A residual plot can show whether the spread of residuals appears to change across fitted values or predictors. But visual judgments can be difficult, especially when the pattern is gradual or the sample is large enough to reveal small departures. The Breusch-Pagan test provides a formal test for whether residual variance is associated with a specified set of variables.
The test does not replace a residual plot. Its result depends on which variables are included in the test, and a small p-value does not describe the size or shape of the variance change. The plot and the test answer related but different questions: the plot can reveal patterns broadly, while the test evaluates a particular, specified pattern.
Model and Hypotheses
Begin with a regression model for the conditional mean:
For the usual Breusch-Pagan setup, errors have conditional mean zero, observations are independent, and the mean model is correctly specified. Under the null hypothesis of constant conditional variance, \(\operatorname{Var}(\varepsilon_i\mid x_{i1},\ldots,x_{ik})=\sigma^2\) for every observation. The classical score-test justification additionally assumes normally distributed errors under the null. The commonly used \(nR^2\) version is an asymptotic test, not an exact small-sample test.
The test assesses whether variance is systematically related to chosen variables \(z_{i1},\ldots,z_{iq}\). These might be some or all of the mean-model predictors, or specified transformations or group indicators. The variables should be chosen to represent a plausible variance pattern; the test does not search automatically over every possible form of heteroskedasticity.
One way to describe the alternative is through a variance model that changes with the \(z\) variables. The auxiliary regression below tests for a linear association between squared residuals and those variables; interpreted as a variance model, it is a local assessment near the constant-variance null. The test is not a general test against every possible change in variance.
Constructing the Auxiliary Regression
First fit the mean regression by ordinary least squares and calculate each residual, \(e_i=y_i-\hat{y}_i\). Then square each residual and use those squared residuals as the response in an auxiliary regression:
The auxiliary regression includes an intercept. Let \(R^2_{\text{aux}}\) be its ordinary coefficient of determination, and let \(q\) be the number of linearly independent variance predictors, not counting the intercept. The Breusch-Pagan LM statistic is
Under the null and the test’s regularity conditions, this statistic has an approximate chi-square distribution with \(q\) degrees of freedom. The p-value is the probability, under that reference distribution, of observing a statistic at least as large as the calculated \(LM\). A small p-value is evidence against constant variance for the specified predictors.
Worked Example: A Two-Predictor Variance Pattern
Suppose a hypothetical study fits a mean regression to \(n=30\) independent observations. Its residual plot has a widening band as fitted values increase. Before examining the test result, analysts specify two variance predictors: one quantitative predictor and a group indicator. The auxiliary regression of the 30 squared residuals on those two predictors and an intercept has \(R^2_{\text{aux}}=0.24\). Assume the mean model is appropriate and the test’s distributional conditions are reasonable.
The hypotheses are \(H_0:\gamma_1=\gamma_2=0\) versus \(H_a:\) at least one of \(\gamma_1,\gamma_2\) is nonzero. There are \(q=2\) tested slopes; the intercept is excluded.
Statistic. Substitute the sample size and auxiliary-regression \(R^2\):
Under \(H_0\), compare \(7.20\) with a chi-square distribution with 2 degrees of freedom. Its upper-tail p-value is approximately \(P(\chi^2_2\ge 7.20)=0.0273\). At significance level \(\alpha=0.05\), reject \(H_0\). The test provides evidence that residual variance is associated with at least one of the two specified predictors. The widening residual band is consistent with this finding, but neither the test nor the plot alone establishes the exact variance function.
Why the Statistic Uses \(nR^2\)
The auxiliary regression captures how much of the variation in squared residuals is explained by the chosen variance predictors. Under the null, squared errors fluctuate even when their variance is constant; the test asks whether their explained variation is unusually large relative to that expected fluctuation. A short asymptotic argument explains the scale of the statistic.
For a centered normal error with variance \(\sigma^2\), the variance of its square is \(2\sigma^4\). Thus, under constant variance, the total centered sum of squares of the squared residuals is approximately \(2n\sigma^4\) in a sufficiently large sample. If \(SS_{\text{explained}}\) is the auxiliary regression’s explained sum of squares, then by definition \(R^2_{\text{aux}}=SS_{\text{explained}}/SS_{\text{total}}\). Consequently,
The expression on the right is the scale of the classical score statistic for testing the variance slopes jointly at zero. Under the null, its large-sample reference distribution is chi-square with one degree of freedom per tested slope, giving the \(q\) degrees of freedom. This argument is an asymptotic justification: it does not make \(nR^2_{\text{aux}}\) exactly chi-square for a small sample.
Worked Example: A One-Predictor Test With Weak Evidence
In a second hypothetical analysis, \(n=24\) independent observations are used to fit a suitable mean model. The test is specified in advance to assess whether variance changes linearly with one quantitative predictor. The auxiliary regression of the squared residuals on that predictor and an intercept has \(R^2_{\text{aux}}=0.10\). The residual plot shows some irregular spread but no clear, sustained fan shape. Assume the test conditions are reasonable.
Here \(q=1\), so the hypotheses are \(H_0:\gamma_1=0\) and \(H_a:\gamma_1\ne0\). The statistic is
With 1 degree of freedom, the upper-tail p-value is approximately \(0.121\). Since \(0.121>0.05\), do not reject \(H_0\) at the 5% significance level. This result does not show that the variance is constant; it indicates that these data do not provide sufficiently strong evidence, by this specified test, of a linear variance association with the chosen predictor. The plot also offers no strong visual pattern, but should still be considered alongside the model and context.
Choosing Predictors and Interpreting the Result
The choice of variance predictors determines what alternative the test can detect. If the suspected spread changes with a fitted value, the relevant fitted value can be used as a variance predictor. If spread may differ across categories, group indicators can be included. A predictor may also be transformed when a particular pattern is motivated, but selecting transformations after repeatedly trying tests can make the reported p-value misleading.
When predictors are correlated, their slopes are tested jointly: a significant result says that at least one contributes to the specified auxiliary regression, not which one is responsible. The degrees of freedom equal the number of independent slopes being tested. If a predictor is redundant because it is an exact linear combination of others, it does not add an independent degree of freedom.
Worked Example: Three Predictors and the Degrees of Freedom
A third hypothetical analysis uses \(n=40\) observations. Based on the diagnostic question, its auxiliary regression includes three nonredundant variance predictors and an intercept. It gives \(R^2_{\text{aux}}=0.18\). The original mean model is considered adequate, and the observations and conditions support using the large-sample reference distribution.
The joint hypotheses are \(H_0:\gamma_1=\gamma_2=\gamma_3=0\) versus the alternative that at least one slope is nonzero. The intercept does not count, so \(q=3\). Calculate
For a chi-square distribution with 3 degrees of freedom, the upper-tail p-value is approximately \(0.066\). At \(\alpha=0.05\), do not reject the constant-variance null. This is not proof of equal variance, and the result would be different under a different predictor set or test specification. A residual plot can still be useful for spotting a pattern the chosen auxiliary regression was not designed to detect.
Use the Test Alongside Diagnostic Plots
A Breusch-Pagan result is best reported with the tested predictors, the test statistic, its degrees of freedom, the p-value, and the visual evidence. For example: “The Breusch-Pagan test using the fitted value and a group indicator gave \(LM=7.20\), \(df=2\), and \(p=0.027\); this is evidence of variance association with at least one specified predictor, consistent with the widening residual spread in the plot.” This phrasing reports what was tested without claiming that the test identifies a unique variance pattern.
A small p-value can flag a departure too subtle to see easily, particularly with a large sample. Conversely, a nonsignificant result can occur when the sample is small, when the departure is weak, or when the chosen predictors do not represent the pattern. Neither outcome should be interpreted without considering the residual plot, sample size, and adequacy of the mean model.
- The test is targeted. It assesses association with the variables included in its auxiliary regression, not every possible form of unequal variance.
- The mean model matters. An incorrect mean pattern can leave systematic structure in residuals and complicate the interpretation of squared-residual regression results.
- The test is not a measure of impact. A small p-value does not say how large the variance change is or whether it matters practically.
Common Mistakes
- Using the original response as the auxiliary response. The auxiliary response is the squared residual \(e_i^2\), not \(y_i\) or \(e_i\).
- Counting the intercept in the degrees of freedom. The reference degrees of freedom are \(q\), the number of independent variance-predictor slopes.
- Treating a nonsignificant result as proof of constant variance. Failure to reject means insufficient evidence against the specified null at the chosen level; it does not establish that the null is true.
- Claiming a significant test identifies the cause. The joint test indicates evidence for an association with at least one included predictor. It does not by itself identify which predictor or the full shape of the variance function.
- Ignoring the residual plot. A test result cannot reveal every pattern, and its interpretation relies on the chosen predictors and an adequate mean model. Read the plot and test together.
Check Your Understanding
Try these questions before reviewing the worked examples.
- In an auxiliary regression with an intercept and four independent variance predictors, what are the null hypothesis and the chi-square degrees of freedom?
- An auxiliary regression has \(n=50\) and \(R^2_{\text{aux}}=0.08\). Calculate the Breusch-Pagan statistic.
- Why does a significant Breusch-Pagan test not establish which predictor is responsible for the variance pattern?
- What does a nonsignificant result allow you to conclude, and what does it not allow you to conclude?
- Why should a residual plot still be examined when the Breusch-Pagan test is reported?