Lesson 4

Consistency of OLS

Big question

When is OLS consistent?

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 consistency of ols in plain language.
  • Use consistency correctly in an interpretation.
  • Connect the lesson idea to a formula, graph, Python result, or real example.

Simple explanation

Under the core multiple-regression assumptions, OLS coefficients converge to their population parameters.

Key terms

consistency
The estimator converges in probability to the true parameter.
zero correlation
A variable has zero covariance with the error.
asymptotic confidence interval
An interval justified by a large-sample approximation.

Core formula

betahat1=beta1+[n1sum(xixbar)ui]/[n1sum(xixbar)2];plim(betahat1)=beta1+Cov(x,u)/Var(x)beta_hat_1 = beta_1 + [n^{-1} sum (x_i-xbar)u_i] / [n^{-1} sum (x_i-xbar)^2]; plim(beta_hat_1)=beta_1+Cov(x,u)/Var(x)

Use plain-language interpretation before algebra.

Example

Consistency of OLS uses simulated data so students can see the large-sample mechanism without inventing empirical results.

Interactive visual

ProbabilityLimitExplorer

Original Module 5 visual for Consistency of OLS.

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

Consistency of OLS Python example

Consistency of OLS 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 5Run this Python instruction as part of the lesson workflow.
  5. Line 6Create or update a Python object used in the analysis.
  6. Line 7Create or update a Python object used in the analysis.
  7. Line 8Run this Python instruction as part of the lesson workflow.
  8. Line 9Run this Python instruction as part of the lesson workflow.
  9. Line 10Create or update a Python object used in the analysis.
  10. Line 11Run this Python instruction as part of the lesson workflow.
  11. Line 12Create or update a Python object used in the analysis.
  12. Line 13Create or update a Python object used in the analysis.
  13. Line 14Create or update a Python object used in the analysis.
  14. Line 15Create or update a Python object used in the analysis.
  15. Line 16Add an intercept column to the regression design matrix.
  16. Line 17Run this Python instruction as part of the lesson workflow.
  17. Line 18Display a result so students can inspect the output.

Python walkthrough

  1. 1Load libraries and data or set a simulation seed.
  2. 2Build the model or simulation that matches the lesson question.
  3. 3Compute the statistic, graph, or summary table.
  4. 4Interpret the result as large-sample evidence, not automatic causality.

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

SIMULATION

Estimated time

25 to 40 min

Packages

pandas, numpy, scipy

Expected output

Simulation output showing how estimates or test statistics behave as sample size changes.

Learning goals

  • Load and inspect SIMULATION.
  • Run the Python cells connected to What Consistency Means.
  • Interpret the output using consistency and simulation.

Common errors

  • File not found: check that WAGE1.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-5/WAGE1.csv")
df.head()

Interactive activity

ProbabilityLimitExplorer

Fill the OLS consistency gap

Change the covariance between x and u and see the probability-limit target move.

Simulation

Inputs

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

When does the simple-regression OLS slope converge to the wrong target?

Quick quiz

Which reporting habit is most important in Consistency of OLS?

Quick quiz

Why is BWGHT2 a reasonable practice dataset here?

Key takeaway

Consistency of OLS helps students separate large-sample approximation from valid research design.