Lesson 8

The Breusch-Pagan Test

Big question

How does an auxiliary regression of squared residuals detect changing variance?

Lesson progress

Complete checkpoints as you learn

0% complete0 checkpoint streak
Progress tracking available after sign-in. Sign in to save your work.
Big question
Concept
Activity
Quiz

Learning objectives

  • Explain the breusch-pagan test in plain language.
  • Use linear probability model correctly in an interpretation.
  • Connect the lesson idea to a formula, graph, Python result, or real example.

Simple explanation

Heteroskedasticity is about changing uncertainty. In the breusch-pagan test, students focus on Breusch-Pagan auxiliary regression and learn how to describe that pattern without confusing it with coefficient bias.

Key terms

Linear probability model
An OLS model for a binary outcome whose error variance depends on the fitted probability.
Homoskedasticity
A constant conditional error variance assumption used by conventional OLS standard errors.
White test
A flexible heteroskedasticity diagnostic using squares and interactions in an auxiliary regression.

Core formula

hatui2=delta0+delta1xi1+...+vi;LM=nR2hat u_i^2 = delta_0 + delta_1 x_{i1}+...+v_i; LM=nR^2

Use plain-language interpretation before algebra.

Example

MODULE8_INCOME_SAVINGS_SYNTHETIC supports original Ceteris Lab practice for the breusch-pagan test. Synthetic files are clearly labeled as synthetic, and installed course datasets are used only when the file is present.

Interactive visual

BreuschPaganStepBuilder: adjust the controls, classify the diagnostic evidence, and write one sentence explaining the implication for inference.

Original Module 8 visual for The Breusch-Pagan Test.

wage_sample.csv

y variable

wage

The dependent variable. It is the outcome students want to explain.

x variable

education

The explanatory variable. It is used to describe changes in wage.

Live Python

The Breusch-Pagan Test Python example

The Breusch-Pagan Test Python example

Stdout

Run Python to see results here.

Status / stderr

Ready to run Python in your browser.

Line-by-line guide

  1. Line 1Load a Python library needed for data work or regression.
  2. Line 2Load a Python library needed for data work or regression.
  3. Line 3Load a Python library needed for data work or regression.
  4. Line 5Load the dataset into a pandas DataFrame.
  5. Line 6Add an intercept column to the regression design matrix.
  6. Line 7Estimate an ordinary least squares regression.
  7. Line 8Create or update a Python object used in the analysis.
  8. Line 9Estimate an ordinary least squares regression.
  9. Line 10Display a result so students can inspect the output.
  10. Line 11Display a result so students can inspect the output.

Python walkthrough

  1. 1Load the Python packages needed for data, regression, diagnostics, or plotting.
  2. 2Read an installed Ceteris Lab dataset from a browser-safe public path.
  3. 3Estimate the baseline model before changing the covariance method or weights.
  4. 4Print diagnostic evidence or a coefficient comparison so students can inspect the result.
  5. 5Interpret the output as practice evidence and avoid making real empirical claims from synthetic data.

Live notebook

Run this lesson as a notebook

Open an editable notebook cell-by-cell, run Python in the browser, and download the `.ipynb` file for later.

Related dataset

MODULE8_INCOME_SAVINGS_SYNTHETIC

Estimated time

25 to 40 min

Packages

pandas, numpy, statsmodels, patsy

Expected output

Printed Python results that can be compared with the lesson explanation.

Learning goals

  • Load and inspect MODULE8_INCOME_SAVINGS_SYNTHETIC.
  • Run the Python cells connected to The Breusch-Pagan Test.
  • Interpret the output using heteroskedasticity and robust standard errors.

Common errors

  • File not found: check that module8_income_savings_heteroskedastic.csv is installed or use the course data folder.
  • Package import error: use the browser notebook first, then download for local Jupyter if your local packages differ.
  • Column name error: compare your variable names with the dataset variables listed for this notebook.

Dataset path helper

import pandas as pd

df = pd.read_csv("/data/module-8/module8_income_savings_heteroskedastic.csv")
df.head()

Interactive activity

Breusch Pagan Step Builder

The Breusch-Pagan Test

change the inputs, inspect the feedback, and decide whether robust inference, diagnostics, WLS, or reporting caution is needed.

MODULE8_INCOME_SAVINGS_SYNTHETIC

Inputs

Visual preview

Changing variance across fitted values

fitted valueresidual spread

A wider fan means the uncertainty changes across observations. Robust standard errors adjust inference; WLS needs a defensible variance model.

Try it yourself

Write one plain-English sentence explaining the main idea from this lesson.

Common mistakes

Check these before you move on.

A regression coefficient describes a pattern unless the assumptions or research design support a causal interpretation.

Quick quiz

What should a careful Module 8 report include for The Breusch-Pagan Test?

Quick quiz

What should a careful Module 8 report include for The Breusch-Pagan Test?

Quick quiz

Why is WAGE1 a reasonable practice dataset here?

Key takeaway

The Breusch-Pagan Test helps students diagnose changing variance and choose inference or weighting methods without overclaiming what those methods can fix.