Charts and Graphs · Chapter 19

Fit a Line and Check It

A trend line sums up a cloud of dots. Check how much one dot moves it, and don’t trust it past the edge of the data.

Home › Calculators › Fit a Line and Check It

Opens on Chapter 19’s example: Millbrook’s twenty cafés: seats against cups sold a day.

Enter your numbers, then press Calculate.

How it works

The correlation r runs from −1 to 1 and says how tightly the dots follow a straight line. The best-fit line is y = a + b × x, with b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)² and a = ȳ − b × x̄. Leaving each point out in turn shows whether one point is doing all the work. A line says nothing about cause, or about x values outside the data.

From the book, Chapter 19. The cafés give r = 0.93 and a line of about 44 + 4.8 cups per seat. Add one busy six-seat kiosk and r falls to 0.28, with a line of 176 + 1.9 per seat. Every chapter and its calculator →

Rounding is half up, the way the book rounds. Numbers can be typed as 1,450, $38, 12% or 2.5 million. Everything stays in your browser: no sign-up, nothing stored or sent.