Home / Statistics Topics

Module 6 · Regression & Correlation · Topic 5

Least Squares Method

Least Squares. The least squares method finds the line that minimizes the sum of the squared residuals (SSE = Σ(yᵢ − ŷᵢ)²). This produces the best-fitting line in terms of vertical distances from data points.

Why Squared?. Squaring the residuals ensures positive and negative errors don’t cancel, penalizes larger errors more, and yields a unique, mathematically tractable solution.

Open the interactive lessonAll topics

Key formulas

Slope via Least Squares

b = Σ[(xᵢ − x̄)(yᵢ − ȳ)] / Σ[(xᵢ − x̄)²]

From the Regression & Correlation formula sheet

  • Least-Squares Regression Line: yhat = a + bx — Line that minimizes the sum of squared residuals.
  • Pearson Correlation: r = sum((x_i-xbar)(y_i-ybar)) / sqrt(sum((x_i-xbar)^2)sum((y_i-ybar)^2)) — Measures direction and strength of a linear association.

See the full formula reference

Worked example

Conceptual Example

Imagine pinning a thread to a scatter plot so it passes through (̄x, ȳ). Rotating it until the sum of squared vertical residuals is minimized gives the least squares line.

Related glossary terms

  • Residual: The observed value minus the predicted value. Example: If y = 12 and yhat = 9, the residual is 3.

Browse the full glossary

Go interactive

Work this topic in StatRise

Start with the free descriptive-statistics module and daily practice; this module's tracked lesson unlocks with Premium.

Regression & Correlation lesson (Premium)Regression calculatorsRegression Lab simulationPractice questions

Free statistics guides

Related in-depth guides

  • How to Choose the Right Statistical Test8 min read
  • Hypothesis Testing Explained: The Five Steps, Worked Through8 min read

Keep reading

More topics

Previous: Simple Linear RegressionNext: R-SquaredAll statistics topics
CalculatorsLessonsPracticeGuidesTopicsPremiumRestore purchasePrivacyTerms

© 2026 StatRise. Statistics calculators, lessons, practice, and simulations — progress stays in your browser, no account required.

More study tools: CalcRef · Discretica · ScoreMint · PhysRef