Least squares regression line

Gives the straight line that minimises the sum of squared vertical differences between observed and predicted y values. It is used to model and predict a linear relationship between two variables from paired data.

\hat{y} = a + bx, \quad b = \frac{\sum (x_i-\bar{x})(y_i-\bar{y})}{\sum (x_i-\bar{x})^2}, \quad a = \bar{y} - b\bar{x}

What the symbols mean

predicted value of the response variable
value of the explanatory variable
intercept of the fitted line
slope of the fitted line
i-th observed value of the explanatory variable
i-th observed value of the response variable
sample mean of the x values
sample mean of the y values

About this formula

  • FieldStatistics
  • TopicRegression analysis
  • LevelHigh school
  • Also calledlinear regression line, line of best fit, ordinary least squares slope, regression slope and intercept, best fit line formula, OLS regression coefficients

Write it in Obsidian

MathLive is a free visual math editor for Obsidian. Run Find a formula, type “least squares regression line”, and it goes into your note as editable LaTeX. You can also scan formulas from screenshots, PDFs and handwriting.

Related formulas