When to use regression
Use simple linear regression when you want to predict or model a numeric outcome from one numeric predictor, and to put a number on the relationship (the slope). If you only need the strength and direction of association, correlation is enough. With several predictors you need multiple regression.
Reading the output
The slope answers “how much does y change per unit of x?” and carries units; the intercept is the baseline; R² near 1 means the line fits closely, near 0 means it barely helps. The p-value on the slope tests whether the true slope differs from zero.
Assumptions (LINE)
- Linearity — the relationship is a straight line; check a scatterplot.
- Independence of residuals.
- Normality of residuals.
- Equal variance (homoscedasticity) — residual spread is constant across x.
Inspect a residual plot to check all four at once — it should look like random scatter.
Common mistakes
- Extrapolation — predicting far outside the observed range of x is unreliable.
- Causation — a fitted line is not proof that x causes y.
- Ignoring influential points — one outlier can swing the slope; explore this in the regression playground.
- Chasing R² — a high R² with a curved residual pattern still means the model is wrong.
Worked example
Advertising spend 1,2,3,4,5 against sales 2,4,5,4,6 fits roughly ŷ = 2.2 + 0.7x with R² ≈ 0.61 — each extra unit of spend adds about 0.7 in sales, explaining 61% of the variation. Enter paired columns above for the full fit and residuals. See the methodology page for details.