Ordinary least squares — the workhorse method for estimating regression lines.
Ordinary least squares (OLS) is the most common way to estimate a regression line. It chooses the intercept and slope that make the line fit the data as closely as possible.
How OLS works
For each observation, the residual is the difference between the actual value of Y and the value predicted by the line. OLS chooses β₀ and β₁ to minimise the sum of squared residuals.
Key idea
OLS finds the line that minimises the sum of squared vertical distances between the data points and the line. Squaring stops positive and negative errors cancelling and penalises large errors more.
The OLS slope formula
β₁ = Cov(X, Y) ÷ Var(X)
The slope is the covariance between X and Y divided by the variance of X. Intuitively, it measures how much X and Y move together, relative to how much X moves on its own.
Assumptions for OLS to work well
For OLS estimates to be unbiased and reliable, key assumptions include:
- Linearity in the parameters.
- Random sampling.
- No perfect multicollinearity: explanatory variables are not exact combinations of each other.
- Exogeneity: the error term is not correlated with the explanatory variables — the most important assumption.
- Homoskedasticity: the error variance is constant (needed for standard textbook standard errors).
When these hold, OLS is the Best Linear Unbiased Estimator (BLUE) — the Gauss–Markov theorem.
When OLS goes wrong
- Omitted variable bias: leaving out a variable that affects Y and is correlated with X biases β₁.
- Measurement error in X tends to bias β₁ towards zero.
- Heteroskedasticity: errors vary in size; estimates remain unbiased but standard errors need correcting (“robust standard errors”).
- Outliers can heavily influence the line.
Worked example
Regressing income on years of education without controlling for ability may overstate the return to education, because more able people both study longer and earn more. Ability is an omitted variable.
Exam tip
Explain what OLS minimises and name the key assumption — exogeneity — that allows a causal interpretation.