Linear Regression

Linear regression fits a straight line (or hyperplane, with multiple predictors) that best predicts a continuous outcome variable from one or more input variables, by minimizing the sum of squared errors between predicted and actual values.

What is linear regression?

It’s the standard starting point for modeling a numeric outcome: given data on an input and an output, linear regression finds the line that comes closest, on average, to every point in the dataset, then uses that line’s equation to predict outcomes for new inputs.

Basic formula

The simple linear regression model is y = β₀ + β₁x + ε, where β₀ is the intercept, β₁ is the slope, and ε is the error term.

Example

Predicting a house’s price from its square footage: the fitted line’s slope tells you the estimated price increase per additional square foot.

Common mistakes

Assuming correlation implies causation; ignoring non-linear relationships that a straight line can’t capture; not checking residuals for patterns that violate model assumptions.

  • Logistic Regression

Questions about linear regression

Per-concept question filtering isn’t wired up yet — browse all worked Statistics problems in the meantime.