# Question Video: Calculating a Least Squares Regression Model from Summary Statistics Mathematics • 9th Grade

For a given data set, βπ₯ = 102, βπ¦ = 1092, βπ₯Β² = 1382, βπ¦Β² = 100392, βπ₯π¦ = 8656, and π = 12. Find the equation of the regression line of π¦ on π₯ in the form π¦ = ππ₯ + π, giving π and π correct to two decimal places.

02:49

### Video Transcript

For a given data set, the sum of π₯ equals 102, the sum of π¦ equals 1092, the sum of π₯ squared is 1382, the sum of π¦ squared is 100392, sum of π₯π¦ is 8656, and π equals 12. Find the equation of the regression line of π¦ on π₯ in the form π¦ equals ππ₯ plus π, giving π and π correct to two decimal places.

Remember, the least squares regression line for a set of bivariate data with variables π₯ and π¦ is given as π¦ hat equals π plus ππ₯. π is essentially the slope or gradient of the line of best fit and is given by π π₯π¦ over π π₯π₯, where π π₯π¦ is found by subtracting the sum of π₯ times the sum of π¦ over π from the sum of π₯π¦. And π π₯π₯ is the sum of π₯ squared minus the sum of π₯ all squared divided by π. And π is the π¦-intercept. Itβs π¦ bar minus ππ₯ bar, where π¦ bar and π₯ bar are the means of π¦ and π₯, respectively.

Weβve been given all of the values we need to be able to calculate each of these. Letβs begin with π π₯π¦, which is the sum of π₯π¦, thatβs 8656, minus the sum of π₯ times the sum of π¦ divided by π. In other words, itβs 8656 minus 102 times 1092 over 12, which is negative 626. Similarly, π π₯π¦ is 1382, thatβs the sum of π₯ squared, minus the sum of π₯ squared, which is 102 squared, divided by 12. Thatβs 515. π is the quotient of these, so itβs negative 626 divided by 515, or negative 1.22 correct to two decimal places.

Now that we have the slope, we can work out the value of the π¦-intercept by using the formula π equals π¦ bar minus π times π₯ bar. π¦ bar is the sum of all of the π¦-values divided by 12, so 1092 divided by 12, which is equal to 91. Similarly, the mean of π₯ is 102 divided by 12, which is 8.5. Then, π is π¦ bar minus π times π₯ bar. So itβs 91 minus negative 626 over 515 times 8.5, which correct to two decimal places is 101.33. And so the regression line can be written as π¦ bar equals 101.33 minus 1.22π₯, or equivalently π¦ equals negative 1.22π₯ plus 101.33.