Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem
Linear regressionStatistics and probabilityCollegeabout 1:22

Find the least-squares regression line for x = 10, 20, 30, 40, 50 and y = 48, 41, 35, 30, 22: animated lesson

A narrated, step-by-step linear regression video lesson with captions. Final answer: ŷ = 541/10 − (63/100)x; r ≈ -0.997615, r² ≈ 0.995236.

Video with a synthetic English voice and captions. Pick another language for subtitles in that language, or open the interactive version.

Video narrated by a synthetic voice (Piper TTS, en_US-ljspeech-high voice (LJ Speech dataset, public domain)); the steps come from our maths engine and the answer was checked independently. Download MP4 (0.6 MB) · Captions (WebVTT)

Steps on screen

  1. 1. The problem
    Worked example
    Find the least-squares regression line for x = 10, 20, 30, 40, 50 and y = 48, 41, 35, 30, 22.
  2. 2. Steps, part 1
    1. xˉ=1505=30,yˉ=1765=1765≈35.2\bar x = \frac{150}{5} = 30,\quad \bar y = \frac{176}{5} = \frac{176}{5} \approx 35.2
      Means of x and y
    2. Sxx=∑(x−xˉ)2=1000,Syy=19945≈398.8,Sxy=∑(x−xˉ)(y−yˉ)=−630S_{xx} = \sum (x-\bar x)^2 = 1000,\quad S_{yy} = \frac{1994}{5} \approx 398.8,\quad S_{xy} = \sum (x-\bar x)(y-\bar y) = -630
      Sums of squares and cross-products about the means
    3. b=SxySxx=−63100≈−0.63b = \frac{S_{xy}}{S_{xx}} = -\frac{63}{100} \approx -0.63
      Slope
    4. a=yˉ−bxˉ=54110≈54.1a = \bar y - b\bar x = \frac{541}{10} \approx 54.1
      Intercept: the line passes through the point of means
  3. 3. Steps, part 2
    1. y^=54110−63100x\hat y = \frac{541}{10} - \frac{63}{100}x
      Regression line
    2. r=SxySxxSyy≈−0.997615,r2≈0.995236r = \frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}} \approx -0.997615,\quad r^2 \approx 0.995236
      Correlation and coefficient of determination
  4. 4. The answer
    y^=54110−63100x\hat y = \frac{541}{10} - \frac{63}{100}x

    b = -63/100 ≈ -0.63, a = 541/10 ≈ 54.1

  5. 5. Check
    • The residuals sum to 0, as they must for a least-squares line.

Transcript

The problem. Here is the problem: Find the least-squares regression line for x equals 10, 20, 30, 40, 50 and y equals 48, 41, 35, 30, 22. Fit the straight line ŷ equals a plus bx that minimises the sum of squared vertical distances to the data, and measure how well it fits with r and r squared.

Steps, part 1. Means of x and y. Sums of squares and cross-products about the means. Slope. Intercept: the line passes through the point of means.

Steps, part 2. Regression line. Correlation and coefficient of determination. Strong negative linear association; about 99.52 percent of the variation in y is explained by the line.

The answer. So the answer is ŷ equals 541 over 10 minus (63 over 100)x; r approximately negative 0.997615, r squared approximately 0.995236. The slope is the predicted change in y for each one-unit increase in x. Correlation measures the strength of the linear pattern, not whether x causes y.

Check. The residuals sum to 0, as they must for a least-squares line.

About linear regression

Fit a least-squares regression line and read its slope and intercept.

Find the least-squares regression line for x = 10, 20, 30…