Econometrics

“Run a regression” is the most repeated instruction in any econometrics course, and ordinary least squares is what the software actually does when you obey it. Most students can click the button; far fewer can derive the estimator, state its assumptions, or say what the Gauss–Markov theorem actually promises. This page teaches all three — and if you are looking for an econometrics tutor who works at university level, it is the place to start.

1 · The model is a claim about a conditional mean

Start with what a regression claims. The population model

    \[y_i = \beta_0 + \beta_1 x_i + u_i\]

says that y is built from three parts: an intercept β0, a slope β1 scaling the observed variable x, and an error u collecting everything else that moves y. The error is not a mistake. It is the honest admission that x is one influence among many, and the rest are unobserved.

Read the slope as a statement about averages: raise x by one unit and the average of y moves by β1, holding the unobserved stuff fixed. Formally, if E[u | x] = 0, then E[y | x] = β0 + β1x — the regression line is the conditional mean of y.

One distinction does real work for the rest of the course. β0 and β1 are population parameters: fixed, unknown, never observed. What you compute from a sample are estimates, β̂0 and β̂1. The whole subject lives in the gap between the two. Keep the hats on. Examiners notice when they slip off.

2 · Deriving the estimator — minimise the squared residuals

Given a sample of n pairs (xi, yi), any candidate line b0 + b1x leaves a residual at each point: ei = yib0b1xi, the vertical distance from the point to the line. OLS picks the line that makes the squared residuals as small as possible:

    \[\min_{b_0,\, b_1} \; S(b_0, b_1) = \sum_{i=1}^{n} \left( y_i - b_0 - b_1 x_i \right)^2\]

Why squares? Squaring stops positive and negative misses cancelling, penalises large misses heavily, and gives a smooth function you can minimise with calculus. Take the two partial derivatives and set them to zero:

    \[\frac{\partial S}{\partial b_0} = -2 \sum_{i=1}^{n} \left( y_i - b_0 - b_1 x_i \right) = 0, \qquad \frac{\partial S}{\partial b_1} = -2 \sum_{i=1}^{n} x_i \left( y_i - b_0 - b_1 x_i \right) = 0\]

These are the normal equations. The first says the residuals must sum to zero. Divide it through by n and it reads ȳ = b0 + b1 — so the OLS line always passes through the point of means (, ȳ). Solve it for b0, substitute into the second equation, and after rearranging you get the estimators:

    \[\hat{\beta}_1 = \frac{\sum_{i=1}^{n} (x_i - \bar{x})(y_i - \bar{y})}{\sum_{i=1}^{n} (x_i - \bar{x})^2}, \qquad \hat{\beta}_0 = \bar{y} - \hat{\beta}_1 \bar{x}\]

The slope is just the sample covariance of x and y divided by the sample variance of x. Nothing mystical — a scaled co-movement measure.

The normal equations also hand you two facts: the residuals sum to zero, and they are uncorrelated with x. Both hold by construction, in every sample, whatever the data look like. They are arithmetic, not evidence the model is right. Exam questions probe that distinction deliberately.

3 · The Gauss–Markov assumptions — and what each one buys

The formulas above work on any spreadsheet. Whether the numbers they produce mean anything depends on five assumptions. Learn them with their price tags attached — what each one buys you.

  1. Linearity in parameters. The population model is y = β0 + β1x + u. Buys: a model the linear estimator can actually recover. y and x can be logs or squares of other variables; only the βs must enter linearly.
  2. Random sampling. The n observations are drawn independently from the same population. Buys: sample averages that stand in for population moments, so the sample can speak for the population at all.
  3. Sample variation in x. The xi are not all identical. Buys: existence. The denominator Σ(xi)² must be positive or the slope formula divides by zero. You cannot estimate the effect of a variable that never varies.
  4. Zero conditional mean. E[u | x] = 0 — the unobserved factors are unrelated to x. Buys: unbiasedness. This is the big one, and the one most often violated: omit a variable that is correlated with x and it fails silently.
  5. Homoskedasticity. Var(u | x) = σ² — the error spread is the same at every x. Buys: the standard variance formula and the “best” in the theorem below. Not needed for unbiasedness.

To see what assumption 4 delivers, substitute the population model into the slope formula. Because Σ(xi)ȳ = 0, the estimator can be rewritten and decomposed:

    \[\hat{\beta}_1 = \beta_1 + \frac{\sum_{i=1}^{n} (x_i - \bar{x})\, u_i}{\sum_{i=1}^{n} (x_i - \bar{x})^2}\]

Truth plus noise. Take expectations conditional on the xs: under assumption 4 every E[ui | x] is zero, the second term vanishes, and E[β̂1] = β1. That is unbiasedness. And if the errors are correlated with x, the second term does not vanish — no sample size fixes it.

4 · The Gauss–Markov theorem — what BLUE promises

Under assumptions 1–5, the theorem says: OLS is the Best Linear Unbiased Estimator of β0 and β1. Unpack it right to left. Unbiased: centred on the truth, as just shown. Linear: within the class of estimators that are linear functions of the yi. Best: the smallest variance in that class. For the slope,

    \[\text{Var}(\hat{\beta}_1 \mid x) = \frac{\sigma^2}{\sum_{i=1}^{n} (x_i - \bar{x})^2}\]

Read the formula like an economist. Precision improves when the errors are quieter (smaller σ²), when the sample grows (more terms in the denominator), and when x varies more (bigger deviations). A dataset where x barely moves gives you a wobbly slope no matter how many observations you buy.

Just as important is what BLUE does not promise. It does not say OLS is the best estimator full stop — only the best linear unbiased one. It says nothing about causality: that is assumption 4’s job, and the theorem takes it as given. And if homoskedasticity fails, OLS stays unbiased but loses “best”, and the variance formula above is simply wrong. The most-tested distinction here: heteroskedasticity damages the standard errors, not the coefficient estimates.

Worked example — iced coffee at a campus café

A campus café logs the daily high temperature x (°C) and iced coffees sold y for five weekdays: (16, 60), (18, 62), (20, 71), (22, 74), (24, 83). Estimate the regression of sales on temperature by hand.

Step 1 — Means. = (16 + 18 + 20 + 22 + 24)/5 = 100/5 = 20. ȳ = (60 + 62 + 71 + 74 + 83)/5 = 350/5 = 70.

Step 2 — Deviations and sums. Deviations of x: −4, −2, 0, 2, 4. Deviations of y: −10, −8, 1, 4, 13. Cross products: (−4)(−10) + (−2)(−8) + 0 + (2)(4) + (4)(13) = 40 + 16 + 0 + 8 + 52 = 116. Squared x-deviations: 16 + 4 + 0 + 4 + 16 = 40.

Step 3 — Estimates. β̂1 = 116/40 = 2.9. β̂0 = 70 − 2.9(20) = 70 − 58 = 12. The fitted line is ŷ = 12 + 2.9x: each extra degree sells 2.9 more iced coffees on average.

Step 4 — Check the residuals. Fitted values: 58.4, 64.2, 70, 75.8, 81.6. Residuals: 1.6, −2.2, 1, −1.8, 1.4 — sum exactly zero, as the first normal equation requires, and the line passes through (20, 70), the point of means. Squared residuals sum to 13.6 against a total sum of squares of 350, so R² = 336.4/350 ≈ 0.96. The check is not optional. It is how you catch your own arithmetic.

Step 5 — Perturbation. A street festival lands on the hottest day, and the (24, 83) observation becomes (24, 95). One number changes. Rerun the machinery: ȳ = 362/5 = 72.4, cross products now 49.6 + 20.8 + 0 + 3.2 + 90.4 = 164.

Step 6 — Resolve. β̂1 = 164/40 = 4.1 and β̂0 = 72.4 − 4.1(20) = −9.6. One observation moved the slope from 2.9 to 4.1 — a 41% jump — and pushed the intercept below zero.

Step 7 — Interpretation. Two lessons. First, squaring residuals makes OLS chase large misses, so a single extreme point at the edge of the x-range carries real leverage — always plot the data before trusting the estimates. Second, and deeper: the festival is an omitted variable. If festivals happen to fall on hot days, the error is correlated with x, assumption 4 fails, and the slope no longer measures the effect of temperature alone. The estimator did not break. The assumption did.

OLS fitted line with residuals as vertical drops y (iced coffees) x (°C) 50 ŷ = 12 + 2.9x e₂ = −2.2 (x̄, ȳ) 70 20
Figure 1 — The worked example, drawn exactly: the five café observations, the fitted line ŷ = 12 + 2.9x, and each residual as a vertical drop. The line passes through the point of means (20, 70).

Can you run the regression but not derive it? That gap — between using OLS and understanding it — is exactly what a one-on-one econometrics tutor closes, working through the derivations and your own problem sets until the algebra stops being a ritual. Book a trial session.

Practice

Q1. A sample of four observations has x = 1, 2, 3, 4 and y = 3, 5, 4, 8.
(a) Compute , ȳ, Σ(xi)(yiȳ) and Σ(xi)².
(b) Compute β̂1 and β̂0 and write out the fitted line.

Q2. Using your line from Q1, compute the fitted value and the residual at x = 3. Then verify that the four residuals sum to zero.

Q3. For the same data, the total sum of squares is Σ(yiȳ)² = 14. Compute the explained sum of squares β̂1² · Σ(xi)² and hence R².

Answers: Q1 (a) x̄ = 2.5, ȳ = 5, Σ(x − x̄)(y − ȳ) = 7, Σ(x − x̄)² = 5; (b) β̂1 = 1.4, β̂0 = 5 − 1.4(2.5) = 1.5, so ŷ = 1.5 + 1.4x. Q2 ŷ = 1.5 + 1.4(3) = 5.7, residual = 4 − 5.7 = −1.7; residuals 0.1, 0.7, −1.7, 0.9 sum to zero. Q3 ESS = 1.96 × 5 = 9.8, so R² = 9.8/14 = 0.7.

Key takeaways

  • OLS minimises the sum of squared residuals; the first-order conditions are the normal equations, and solving them gives β̂1 = Σ(xi)(yiȳ)/Σ(xi)² and β̂0 = ȳβ̂1.
  • By construction, residuals sum to zero, are uncorrelated with x, and the fitted line passes through (, ȳ) — in every sample, whether or not the model is true.
  • Zero conditional mean, E[u | x] = 0, is what buys unbiasedness. Homoskedasticity buys the variance formula and efficiency — nothing more.
  • Gauss–Markov: under the five assumptions, OLS is the minimum-variance estimator among linear unbiased ones. BLUE is a promise about precision, not about causality.
  • Heteroskedasticity leaves the coefficients unbiased but breaks the standard errors — a favourite exam distinction.

Why students choose our econometrics tutoring

  • One-on-one format: every session is private and built around your course — your lecture notes, your problem sets, your university’s notation and exam style.
  • University-level specialists: our tutors teach econometrics as your department teaches it, from OLS and Gauss–Markov through inference, in whichever software your course requires.
  • Derivation-first exam prep: sessions rehearse exactly what examiners ask — derive the estimator, state the assumptions, prove unbiasedness — with past papers and marking schemes in view.

FAQ

Q: What is OLS in econometrics?
A: Ordinary least squares fits a line to data by choosing the intercept and slope that minimise the sum of squared residuals — the squared vertical gaps between each point and the line. It is the default estimator for linear regression.

Q: What are the Gauss–Markov assumptions?
A: Five conditions: the model is linear in parameters, the sample is random, x varies in the sample, the error has zero conditional mean given x, and the error variance is constant (homoskedasticity). Together they make OLS the best linear unbiased estimator.

Q: What does BLUE mean in econometrics?
A: Best Linear Unbiased Estimator. Among all estimators that are linear in y and unbiased, OLS has the smallest variance. It is a claim about precision within a class — not a claim that OLS is always the right tool.

Q: What is the difference between the error term and the residual?
A: The error u is the unobservable gap between y and the population line — a feature of the model. The residual e is the computable gap between y and your fitted line — a feature of the sample. Residuals estimate errors; they are never the same thing.

Q: What happens if homoskedasticity fails?
A: The OLS coefficients stay unbiased, but the usual standard-error formula is wrong, so t-statistics and confidence intervals can mislead. The standard fix is heteroskedasticity-robust standard errors, which most courses cover right after Gauss–Markov.

Book an econometrics tutor

Whether you are staring at a problem set that says “derive the OLS estimator” or preparing for an exam that will, a one-on-one session turns the algebra on this page into marks. Tell us your university and module, and we will match you with the right tutor this week.

Get Started

See the #1 economics
mentoring platform in action