Skip to content
Tutorials Center
My learning

Topics

Lesson 28 of 49 ยท Violations: Heteroskedasticity and Autocorrelation

Chapter 5 review: violations of the error assumptions

Review chapter 5: a one-picture summary, a recap table of detect, repair and report, a diagnostics toolkit in Python, and a ten-question quiz.

This chapter had one message: OLS coefficients are tough, but OLS standard errors are fragile. When the error variance is uneven or the errors are correlated across observations, the slopes remain unbiased, yet the numbers you use to judge them, standard errors, t statistics, p-values and confidence intervals, become unreliable. The cure is a three-step habit: detect, repair, report.

Three columns summarising the chapter: detect, repair and report, with a rule of thumb underneath.
Chapter 5 in one picture: detect the problem, repair the inference, report what you did.

What you will learn

  • A compact recap of every concept in the chapter.
  • A reusable diagnostics function that runs the main checks in one call.
  • Ten mixed questions to test your grasp.

Key terms

Heteroskedasticity: Var(u|x) not constant. Autocorrelation: Corr(ut, us) โ‰  0 for t โ‰  s. HC / HAC: robust covariance estimators for uneven variance, and for uneven variance plus serial correlation. WLS / FGLS: reweighted estimation that is efficient when the variance model is right. LM test: a test based on n ร— Rยฒ of an auxiliary regression.

Recap table

Problem What breaks Detect Repair
Heteroskedasticity Usual SEs, t and F tests; efficiency Residual-versus-fitted plot, Breusch-Pagan, White HC3 robust SEs; WLS or FGLS if the form is known
Autocorrelation (strictly exogenous regressors) Usual SEs; efficiency Residual plot over time, ACF, Durbin-Watson, Breusch-Godfrey Newey-West HAC SEs; add dynamics; GLS
Autocorrelation with a lagged dependent variable Consistency of OLS itself Breusch-Godfrey (not Durbin-Watson) Respecify the dynamics; consider instruments
Both together (typical in time series) Everything above Both sets of tests HAC errors

Three ideas deserve a second reading:

  1. Bias versus variance. The problems here concern the variance of the estimators. Bias comes from endogeneity, which is chapter 6's subject.
  2. The sandwich. Robust estimators put the squared residual (or, for HAC, cross-products of residuals at nearby dates) into the meat of (X'X)โปยน [meat] (X'X)โปยน.
  3. Efficiency is a separate benefit. Robust errors repair inference. WLS and GLS can also tighten the estimates, but only if the model for the variance is right.

A diagnostics toolkit

Combine everything into a single function. It takes a design matrix X (with a constant) and a response y, and returns the slopes, the usual, HC3 and Newey-West standard errors, the Breusch-Pagan p-value and the Durbin-Watson statistic. This is a teaching tool built from numpy and scipy, not a replacement for a statistical package.

Python One-call diagnostics

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Read the output the way a referee would. The data were built with both problems, so the usual standard error should be the smallest, HC3 should help partly, and the Newey-West version should be larger still because it also accounts for the persistence. The tests should flag both issues.

Which error structure when?

A second, visual check of the habit: simulate many samples from the same data-generating process and compare how often each standard error covers the true slope.

Python Which standard error covers the truth?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The usual interval should miss the target by the widest margin. HC3 improves on it because it handles the uneven variance, but it ignores the persistence. The HAC interval is the closest to the promised 95%, yet all three fall short: with only 120 observations and strong persistence in both the regressor and the error, even HAC errors are optimistic. Robust methods are large-sample repairs, not magic.

Common misconceptions

"If robust standard errors differ from the usual ones, my model is wrong." They differ because the variance structure differs, not necessarily because the mean equation is wrong. (Large differences are still worth a look at the specification.)

"HAC fixes everything about time series." It fixes inference for a given equation. Unit roots, spurious regression and endogeneity need other tools, the subject of the next two chapters.

Check your understanding

Quick check ยท 10 questions

of 10 answered You scored / 10 ยท perfect!

  1. 1. Under heteroskedasticity with strictly exogenous regressors, OLS coefficients are...

    Unbiasedness depends on E(u|x) = 0, which heteroskedasticity does not violate.
  2. 2. Which statistic from the Breusch-Pagan test is compared with a chi-square critical value?

    LM = n x R-squared from the regression of squared residuals on the regressors.
  3. 3. A Durbin-Watson d of about 3.4 points to...

    d is approximately 2(1 - rho), so 3.4 implies rho of about -0.7.
  4. 4. The best default for cross-sectional regressions when you do not know the form of the variance is...

    Robust standard errors need no model for the variance.
  5. 5. Weighted least squares is efficient only if...

    WLS is BLUE for the transformed model when the weights are the inverse variances up to a constant.
  6. 6. With a lagged dependent variable among the regressors, which test of autocorrelation is valid?

    Durbin-Watson is biased toward 2 in that case; Breusch-Godfrey includes the regressors in its auxiliary regression.
  7. 7. In the Newey-West estimator, the Bartlett weights w_l = 1 - l/(L+1) ...

    Distant lags get smaller weights, which also keeps the covariance estimate positive semi-definite.
  8. 8. Positive autocorrelation and persistent regressors usually make the usual t statistics...

    Standard errors are too small, so t statistics are inflated.
  9. 9. A White test with three regressors (all continuous, no dummies) uses how many auxiliary terms?

    k(k+3)/2 = 3 x 6 / 2 = 9: three levels, three squares and three cross-products.
  10. 10. Failing to reject in a Breusch-Pagan test means...

    Absence of evidence is not proof, especially with modest samples.

Summary

  • Heteroskedasticity and autocorrelation spare the slopes but damage standard errors, tests and efficiency.
  • Detect with plots first, then Breusch-Pagan or White (cross-sections) and Durbin-Watson or Breusch-Godfrey (time series).
  • Repair with HC3 or Newey-West errors; use WLS or FGLS only when you trust the variance model.
  • Report which errors you used and show the usual ones if they differ.

Next: Chapter 6 overview: borrowing clean variation