Skip to content
← All questions

What is the formula for the least-squares slope in simple linear regression?

The least-squares slope is calculated as the sum of the products of centered x and y values, divided by the sum of squared centered x values. Mathematically, this is Σ[(xi−xˉ)(yi−yˉ)]/Σ(xi−xˉ)2\Sigma[(x_i - \bar{x})(y_i - \bar{y})] / \Sigma(x_i - \bar{x})^2.

Conditions

  • The denominator Σ(xi−xˉ)2\Sigma(x_i - \bar{x})^2 is positive.
  • The model is simple linear regression with an intercept.

Reasoning, step by step

  1. Center each x value by subtracting the sample mean xˉ\bar{x}.
  2. Center each y value by subtracting the sample mean yˉ\bar{y}.
  3. Multiply the centered x and y values for each observation and sum these products.
  4. Square the centered x values for each observation and sum these squares.
  5. Divide the sum of products by the sum of squares to get the slope.

Example

The script states: 'The slope is Σ[(xᵢ−x)(yᵢ−)] divided by Σ(x−xx-x̄)², provided the denominator is positive.'

Common misconceptions

  • Using uncentered values in the numerator.
  • Forgetting to square the centered x values in the denominator.

Watch the explanation

Connected concepts

Explore next

Related questions

Understand why

↗
Meet the concept

↗
Find a method

↗
Understand why

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.