The line that missed the curve

An algorithm can find the best straight line without finding the right model.

Interactive laboratory 12 · Regression diagnostics

A straight line cannot explain a curve

Change the amount of curvature in nine synthetic observations. We fit a new least-squares straight line every time, then inspect the residuals: observed minus predicted. The top plot is the data and fitted line; the bottom plot shows what the line missed.

Fitted slope—
Intercept—
R²—
Numerical dataset, fitted values, and residuals
xObserved yPredicted yResidual

A small R² may signal a poor linear fit, but even a large R² cannot establish causation or guarantee valid extrapolation. Residual patterns help reveal model misspecification.

Read the accompanying lesson →