Breusch-Godfrey Test Calculator

Inputs

p-value0.1040
LM statistic (n - p) x R-squared7.68
Degrees of freedom (lags tested)4
Verdict at the 5% levelDo not reject the null at 5%
How this was calculated
  1. Inputs: 100 observations, auxiliary R-squared 0.0800, 4 lags of the residuals in the auxiliary regression.
  2. LM = (n - p) x R-squared = (100 - 4) x 0.0800 = 7.68.
  3. Under the null of no serial correlation the statistic is chi-square with 4 degrees of freedom.
  4. The p-value is 0.1040: do not reject the null at 5%.

A regression whose errors remember yesterday is a regression whose standard errors lie. The Breusch-Godfrey test is the standard check: regress the residuals on everything in the original model plus p of their own lags, and see whether the lags explain anything. If they do, the errors are serially correlated and the inference needs repair. Enter the sample size, the auxiliary regression's R-squared and the lag order, and this calculator returns the LM statistic and its chi-square p-value under the convention stated on the page.

Worked examples

Mild residual correlation, not significant

(100 · 0.08 · 4)

p-value0.1040
LM statistic (n - p) x R-squared7.68
Degrees of freedom (lags tested)4
Verdict at the 5% levelDo not reject the null at 5%

Clear serial correlation

(60 · 0.21 · 2)

p-value0.0023
LM statistic (n - p) x R-squared12.18
Degrees of freedom (lags tested)2
Verdict at the 5% levelReject the null of no serial correlation at 5%

Large sample, tiny auxiliary R-squared

(250 · 0.015 · 6)

p-value0.7226
LM statistic (n - p) x R-squared3.66
Degrees of freedom (lags tested)6
Verdict at the 5% levelDo not reject the null at 5%

Why residual autocorrelation matters

Serial correlation does not bias coefficient estimates in a model with strictly exogenous regressors, which tempts people to ignore it. What it corrupts is precision: standard errors shrink below their true values, t-statistics inflate, and effects appear significant that are not. With a lagged dependent variable among the regressors the damage is worse - the coefficients themselves become inconsistent, because the regressor is correlated with the error by construction.

The test exists because the eye cannot be trusted here. Residual plots of time-series regressions look patterned at sample sizes where the pattern is noise, and look calm at sizes where a formal test rejects decisively. The auxiliary regression replaces impression with a statistic whose distribution under the null is known.

  • Detects serial correlation of any specified order p
  • Valid with lagged dependent variables, unlike Durbin-Watson
  • Statistic: (n - p) x R-squared from the auxiliary regression
  • Chi-square with p degrees of freedom under the null

The auxiliary regression

Construction is mechanical. Estimate the main regression and keep the residuals. Regress those residuals on all the original regressors - they must be included, or the test confounds correlation with misspecification - plus the residuals lagged 1 through p. The R-squared of that second regression, scaled by the number of usable observations, is the test statistic. This calculator uses the (n - p) scaling, the convention under which the first worked example's numbers run: 100 observations, four lags, an auxiliary R-squared of 0.08, giving LM of 7.68.

Some packages scale by n instead, which inflates the statistic slightly; at large samples the difference is immaterial, at small ones it can move a borderline verdict, which is why the convention belongs on the page rather than in a footnote. The chi-square reference distribution then does its work: 7.68 on four degrees of freedom gives a p-value of 0.1040, and the null of no serial correlation survives.

Worked examples

Example 1: Observations n 100; Auxiliary regression R-squared 0.08; Lag order p 4. p-value = 0.1040. Supporting values: LM statistic (n - p) x R-squared 7.68; Degrees of freedom (lags tested) 4; Verdict at the 5% level Do not reject the null at 5%. Inputs: 100 observations, auxiliary R-squared 0.0800, 4 lags of the residuals in the auxiliary regression. LM = (n - p) x R-squared = (100 - 4) x 0.0800 = 7.68. Under the null of no serial correlation the statistic is chi-square with 4 degrees of freedom. The p-value is 0.1040: do not reject the null at 5%.

Example 2: Observations n 60; Auxiliary regression R-squared 0.21; Lag order p 2. p-value = 0.0023. Supporting values: LM statistic (n - p) x R-squared 12.18; Degrees of freedom (lags tested) 2; Verdict at the 5% level Reject the null of no serial correlation at 5%. Inputs: 60 observations, auxiliary R-squared 0.2100, 2 lags of the residuals in the auxiliary regression. LM = (n - p) x R-squared = (60 - 2) x 0.2100 = 12.18. Under the null of no serial correlation the statistic is chi-square with 2 degrees of freedom. The p-value is 0.0023: reject the null of no serial correlation at 5%.

Example 3: Observations n 250; Auxiliary regression R-squared 0.015; Lag order p 6. p-value = 0.7226. Supporting values: LM statistic (n - p) x R-squared 3.66; Degrees of freedom (lags tested) 6; Verdict at the 5% level Do not reject the null at 5%. Inputs: 250 observations, auxiliary R-squared 0.0150, 6 lags of the residuals in the auxiliary regression. LM = (n - p) x R-squared = (250 - 6) x 0.0150 = 3.66. Under the null of no serial correlation the statistic is chi-square with 6 degrees of freedom. The p-value is 0.7226: do not reject the null at 5%.

Choosing the lag order p

The lag order is the test's one real judgement call. Too small and the test is blind to the correlation that matters - annual patterns in quarterly data live at lag 4, monthly seasonality at lag 12. Too large and the test spends its degrees of freedom on lags nobody believes in, diluting power against the plausible alternatives. Practice follows the data's frequency: one or two lags for annual data, four for quarterly, up to twelve for monthly, checked against what the residual correlogram suggests.

The second and third examples mark the ends of the spectrum. Sixty observations with an auxiliary R-squared of 0.21 at two lags give LM of 12.18 and a p-value of 0.0023 - the residuals are plainly carrying information from their past. Two hundred and fifty observations with an R-squared of only 0.015 at six lags give LM of 3.66 and a p-value of 0.7226: a large sample acquitting the model, which is stronger evidence than a small sample doing so.

BG vs Durbin-Watson

The Durbin-Watson statistic is the older instrument and the narrower one: it tests first-order correlation only, its distribution depends on the regressors, it has an inconclusive zone, and it is invalid outright when a lagged dependent variable is present - precisely the dynamic models where serial correlation does the most damage. Breusch-Godfrey generalises it on every axis: any order, a clean chi-square limit, no inconclusive region, and validity in dynamic models.

Durbin-Watson survives as a descriptive statistic - a value near 2 still reassures at a glance - but as a test it has been superseded. Running both is harmless; reporting only Durbin-Watson in a dynamic model is a methodological tell.

What to do when the test rejects

Rejection is a symptom with several possible diseases. The errors may be genuinely autocorrelated, calling for HAC standard errors of the Newey-West type or a GLS transformation. Or the dynamics may be underspecified - a missing lag of the dependent variable or of a regressor often shows up as residual correlation, and adding it is a better repair than robustifying standard errors around a wrong model. Or a structural break may be masquerading as persistence.

The order of operations matters: respecify first, then re-test, and only then reach for corrected standard errors. The calculator's role in that workflow is the fast, honest first step - a number and a p-value that say whether there is anything to repair.

The test's relationship with its own auxiliary regression deserves one more precision. The R-squared that enters the statistic is not the explanatory power anyone cares about in itself - a high value can arise because the original regressors, which belong in the auxiliary regression, soak up residual patterns for reasons unrelated to serial correlation. What the chi-square distribution prices is the joint contribution of the lagged residuals specifically, with the regressors present as controls. This is why the calculator asks only for the finished R-squared and the lag count: the statistic's construction has already separated the signal from the controls, and the p-value belongs to the lags alone.

Practitioners running the test inside software should also know which R-squared they were handed. Some implementations report the statistic scaled by the full sample rather than by n minus p, and at the first example's settings that variant would report a visibly larger number than 7.68 for identical data. Neither is wrong - they are different finite-sample conventions with the same limit - but a reported LM without its convention is a number without a unit, and replication exercises fail on exactly this point more often than on any formula.

It is worth being explicit about the null's wording, because the verdict is often misreported. The null is not 'the model is correct'; it is the narrow statement that the errors show no serial correlation up to the order tested. A model can pass at order 4 and fail at order 6, pass in one sample period and fail in the next, and pass while being misspecified in ways the test never interrogates. The first example's p-value of 0.1040 acquits the residuals of one specific charge. Reporting it as a general certificate of health is the commonest abuse of an otherwise honest statistic, and the calculator's verdict line is worded narrowly on purpose.

One habit worth forming: archive the auxiliary regression's summary beside the headline statistic. Future readers - including the author, six months later - will want to know which lags carried the signal, and the LM number alone has forgotten. The summary costs nothing to keep and turns a bare verdict into evidence that can be re-argued when the model is revisited.

Kept with the model file, that summary also future-proofs the result against software changes in how the test's p-value is computed.

FAQs

What LM statistic does the first worked example give?

7.68: (100 - 4) times the auxiliary R-squared of 0.08, on four degrees of freedom.

What is its p-value?

0.1040 - above 5%, so the null of no serial correlation is not rejected for that regression.

What LM does the second example give?

12.18, from 60 observations, two lags and an auxiliary R-squared of 0.21.

What p-value goes with it?

0.0023 - a decisive rejection; the residuals carry clear first and second-order correlation.

What LM does the third example give?

3.66: (250 - 6) times a small auxiliary R-squared of 0.015.

What is the third example's p-value?

0.7226. Even at six lags and 250 observations there is no trace of serial correlation - a strong acquittal.

Sources

Related calculators

Durbin-Watson Statistic Calculator
The Durbin-Watson statistic for first-order autocorrelation in regression residuals, from eight residuals in time order, with the implied lag-1 autocorrelation.
Breusch-Pagan Test Calculator
The Breusch-Pagan heteroskedasticity test: LM statistic from n and the auxiliary R-squared, with the chi-square p-value and the 5% verdict.
Ljung-Box Test Calculator
The Ljung-Box portmanteau test for residual autocorrelation from a sample size and the first five lag autocorrelations, with chi-square p-value.