### Video Transcript

If the sum of π₯ equals 21, the sum of π¦ equals negative three, the sum of π₯ squared equals 91, the sum of π¦ squared equals 19, the sum of π₯π¦ equals negative 28, and π equals six, find the regression line equation of π¦ on π₯.

The regression line equation of π¦ on π₯ is of the form π¦ equals π plus ππ₯, where π and π are constants. And it describes the equation of the straight line which most closely fits the given data. The values of π and π are chosen so that the sum of the squares of the residuals, which are the differences between each actual value and the value as predicted by the line, is made as small as possible. It is minimised. There are standard formulae that we can apply in order to calculate the values of π and π. π is equal to π π₯π¦ over π π₯π₯, where π π₯π¦ and π π₯π₯ are defined as follows. π π₯π¦ is equal to the sum of π₯π¦ minus the sum of π₯ multiplied by the sum of π¦ over π. And π π₯π₯ is equal to the sum of π₯ squared minus the sum of π₯ all squared over π.

Notice that there is a key difference between the two pieces of notation used in the definition of π π₯π₯. The sum of π₯ squared means that we square each individual π₯-value first and then find the sum. Whereas the sum of π₯ all squared means that we find the sum of the π₯-values first and then square the result. We must be clear on the distinction between these two things. Once we found the value of π, we can work out the value of π by recalling that one point which will always lie on this straight line is the point π₯ bar, π¦ bar. Thatβs the point whose π₯-coordinate is the mean of the π₯-values and whose π¦-coordinate is the mean of the π¦-values.

If this point lies on the line, then its coordinates satisfy the equation of the line. So we have π¦ bar is equal to π plus ππ₯ bar. By subtracting ππ₯ bar from each side, and here Iβve swapped the two sides of the equation around, we have an equation that we can use to calculate π. π is equal to π¦ bar minus ππ₯ bar. Weβve been given all of the summaries that we need to work out each of these quantities in the question. So letβs begin.

For π π₯π¦ first of all, the sum of π₯π¦ is equal to negative 28. The sum of π₯ is equal to 21, and the sum of π¦ is equal to negative three. π is equal to six. So we have negative 28 minus 21 times negative three over six. This simplifies to negative 28 plus 63 over six, which is equal to negative 17.5. In our calculation of π π₯π₯ next, we have the sum of π₯ squared which is equal to 91. We then subtract the sum of π₯ all squared, so thatβs 21 squared, over π, which is equal to six, giving 91 minus 21 squared over six. That simplifies to 91 minus 441 over six, which is equal to 17.5.

So now we have the values of π π₯π¦ and π π₯π₯. We can substitute into the formula for calculating π. This gives negative 17.5 over 17.5, which simplifies to negative one.

Next, we need to calculate the value of π. And to do this, we first need to work out the values of π₯ bar and π¦ bar. To do so, we recall that to find the mean of a set of data we add them all up and divide by how many pieces of data there are. So π₯ bar is equal to the sum of π₯ over π. And π¦ bar is equal to the sum of π¦ over π. For π₯ bar, we have 21 over six which is equal to 3.5. And for π¦ bar, negative three over six which is equal to negative 0.5. We can now substitute the values of π¦ bar, π, and π₯ bar into the formula for calculating π. And it gives π equals negative 0.5 minus negative one multiplied by 3.5. Thatβs negative 0.5 plus 3.5 which is equal to three.

Finally, we substitute the values that we found for π and π into the equation of our straight line. π is equal to three, and π is equal to negative one. So our equation is π¦ equals three minus π₯. We can, of course, write the equation the other way round if we wish. π¦ equals negative π₯ plus three. So we found the equation of the regression line of π¦ on π₯. Itβs equal to π¦ equals three minus π₯. As this line has a gradient of negative one, it means that there is negative correlation between π₯ and π¦.