Ordinary Least Squares (OLS) Regression

Econometrics
Introduced by
Wooldridge (textbook treatment); classical least squares
Year
2019
Type
Linear regression

What does it do?

Ordinary Least Squares is the classical linear regression method that explains a continuous outcome as a linear combination of predictors.

It estimates the coefficients by minimising the sum of squared residuals, and under the Gauss-Markov assumptions these estimates are the best linear unbiased estimator (BLUE).

The intuition behind the method

Imagine fitting a straight line (or a flat plane in higher dimensions) through a cloud of data points. OLS chooses the line whose total squared vertical gap to the points is as small as possible, so it sits as close as it can to every observation at once. Each fitted slope then tells you how much the outcome is expected to move when one predictor changes and the others stay fixed.

History

Ordinary least squares is the classical estimator for linear regression and is among the most widely used statistical methods. A widely used applied text describes OLS as the most common variety of statistical analysis today. Its optimality among linear unbiased estimators is expressed in the Gauss-Markov theorem.

When to use it

Choose OLS when the outcome is continuous and you want to estimate how predictors relate to it through a model that is linear in the parameters. The sample should be large enough relative to the number of predictors; with very few observations the coefficients are unstable and their standard errors are wide. Coefficient-level inference rests on large-sample approximations to the distributions of the OLS test statistics, so it is most reliable when the sample is reasonably large. Exact small-sample t and F inference additionally assumes normally distributed errors; this normality assumption concerns the errors, not the distribution of the outcome or the predictors. Inference is most trustworthy when the Gauss-Markov conditions hold: a linear mean in the parameters, no perfect collinearity, regressors that are exogenous (the error has zero conditional mean given them), constant error variance, and, for time-series data, no serial correlation in the errors. Do not use plain OLS when the outcome is binary or a count. For a binary outcome, logistic or probit regression is generally more appropriate; for counts, Poisson or negative binomial regression is generally preferred. Also avoid plain OLS when the question concerns conditional quantiles rather than the mean, when a regressor is correlated with the error (endogeneity, which biases the coefficients), or when the error variance clearly differs across observations and no robust correction is planned. When many predictors are strongly correlated, penalised alternatives such as ridge or lasso regression can stabilise the estimates.

Limitations and considerations

  • In small samples the coefficients become unstable and their standard errors widen, so the estimates are hard to separate from noise.
  • Strong multicollinearity (a VIF above 10 is a common rule of thumb) inflates the variance of individual coefficients, making them imprecise and hard to interpret even when the overall fit is good.
  • Heteroscedasticity leaves the coefficient estimates unbiased but makes the usual standard errors invalid, so the t and F tests are misleading unless robust standard errors are used.
  • The estimates are biased if a regressor is correlated with the error term, and increasing the sample size does not remove this bias.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Best linear unbiased estimator (BLUE) under the Gauss-Markov assumptions: among linear unbiased estimators, none has a smaller sampling variance.
  • Computed in one closed-form step from the normal equations, without iterative optimisation.
  • Coefficients are directly interpretable: each βⱼ is the expected change in y for a one-unit increase in xⱼ, holding the other predictors constant, provided the model is correctly specified.

Applications

  • Forecasting a continuous quantity, such as sales, prices or demand, from observed predictors.
  • Estimating the association between one predictor and a continuous outcome while controlling for other observed factors.
  • Econometric modelling of linear relationships between continuous economic variables.

How it works

How it works

1

The model expresses the outcome as a linear function of the predictors X plus an error term ε. The coefficients β measure how strongly each predictor is associated with the outcome, holding the other predictors fixed.

Formula
\hat{y} = X\beta + \varepsilon
2

When XᵀX is invertible, which requires that no predictor is a perfect linear combination of the others, the least-squares solution β̂ = (XᵀX)⁻¹Xᵀy is the unique coefficient vector that minimises the sum of squared residuals. It is obtained from the data in one closed-form calculation, without iterative search.

Formula
\hat{\beta} = (X^{\top}X)^{-1}X^{\top}y

Common pitfalls

  • Relying on the usual t and F tests after a Breusch-Pagan test flags heteroscedasticity; the standard remedy is heteroskedasticity-robust standard errors within OLS.
  • Ignoring a high VIF: collinear predictors make individual coefficients uninterpretable even when the joint prediction is adequate.
  • Interpreting unstable coefficients from a very small sample as substantive effects.
  • Treating residual diagnostics as optional. Serial correlation in the residuals (checked with the Durbin-Watson statistic in time-series data) and influential observations (checked with Cook's D) can distort inference. Normality of the errors matters mainly for exact small-sample t and F inference; it is not needed for the BLUE property.

Frequently asked questions

What does R² mean in OLS?

R² is the proportion of the variance in the outcome explained by the model. Because plain R² always rises when predictors are added, judge overall fit with adjusted R² and the F-test instead.

What is heteroscedasticity and why does it matter?

Heteroscedasticity means the error variance is not constant across observations, which violates a Gauss-Markov assumption. It does not bias the coefficient estimates, but the usual standard errors become invalid, so the t and F tests are misleading. A Breusch-Pagan test detects it, and heteroskedasticity-robust standard errors are the standard remedy within OLS.

How do I detect multicollinearity?

Compute the variance inflation factor (VIF) for each predictor; a VIF above 10 is a common rule of thumb for strong collinearity. Collinear predictors inflate standard errors and make individual coefficients hard to interpret.

When should I use ridge or lasso instead of OLS?

When predictors are strongly collinear or the sample is small, OLS coefficients become unstable. Ridge regression shrinks coefficients to stabilise them, and lasso regression can also set redundant predictors to zero, trading a little bias for lower variance.

Related methods

Sources

  1. Wooldridge, J. M. (2019). Introductory Econometrics: A Modern Approach (7th ed.). Cengage Learning.

    ISBN: 978-1337558860
  2. Hayes, pp. 54-55

  3. Introduction to Econometrics, Global Edition (2020), p. 159

  4. R in Action, Data Analysis and Graphics with R, 2nd Edition, p. 169