Skip to content
Monte

Simple regression

  1. Read it, not yet
  2. Practice it, not yet
  3. Master it, not yet

Regression fits the line with the smallest squared misses. Slope: how much y moves per unit of x. R²: the share of y's variation explained. t-test: does x help?

Why it matters

Regression draws the best straight line through a cloud of points, so x can predict y.

It turns “these move together” into a number: each extra unit of x is worth this much y.

  • PricingHow much demand drops for every $1 of price.
  • MarketingSales per $1,000 of ad spend, with care about cause and effect.
  • Real estatePrice per extra square foot.

Everyday example

Does advertising move sales? Six weeks give Sales = 1.43 + 1.14 Adv: each extra unit of ads adds about 1.14 units of sales. R² = 87.1%: the line explains most of the scatter. t = 5.19 (p = 0.007): not luck.

Least squares: six weeks of data plus one point you control

0369120816Advertising (x)

Base line (dashed): Sales = 1.43 + 1.14 Adv, R² = 87.1%. Tick the box to add a point you control.

Check yourself

  1. Σx = 24, Σy = 36, Σxy = 176, Σx² = 124, n = 6. Slope?

  2. Intercept?

  3. Predict sales at 8 units of advertising?

The trap

The mistake people make most on this one.

Correlation is symmetric; regression is not. Swap x and y and you get a different line. Never predict outside the x range you have.

Formulas

7 formulas and a way to remember them.
Line
ŷ = b₀ + b₁x
Slope
b₁ = [nΣxy − ΣxΣy] / [nΣx² − (Σx)²]
Intercept
b₀ = ȳ − b₁x bar
Fit
SST = SSR + SSE, R² = SSR / SST = 1 − SSE / SST
Residual SD
s = √(SSE / (n − 2))
Slope test
t = b₁ / SE(b₁), df = n − 2
Correlation
r = ±√R², with the sign of the slope
Remember it
Slope is rise over run. R² is how much scatter the line explains. The t-test asks: is the slope really nonzero?

Watch and go deeper

3 free videos and pages.