### Video Transcript

The table shows the relation between the variables π₯ and π¦. Find the equation of the regression line in the form π¦ hat is equal to π plus ππ₯. Approximate π and π to three decimal places.

In this question, weβre given a table of data points which show a relationship between two variables, the variable π₯ and the variable π¦. We need to use this table to find the equation of the regression line linking π₯ and π¦. Thatβs the line of best fit. Weβre told to give our answer in the form π¦ hat is equal to π plus ππ₯. Weβre also told we only need to approximate the value of π and π to three decimal places.

To answer this question, letβs start by recalling how we find the least squares regression line linking two variables π₯ and π¦. We recall to find the least squares regression line between two variables π₯ and π¦, we can use the following formula. π will be equal to π sub π₯π¦ divided by π sub π₯π₯, where π sub π₯π¦ is a measure between the covariance of π₯ and π¦ and π sub π₯π₯ is a measure of the variance of π₯. And our value of π is going to be equal to π¦ bar minus π times π₯ bar, where π₯ bar is the mean π₯-value and π¦ bar is the mean π¦-value. Of course, this alone is not quite enough to find the values of π and π. We also need the formula for π sub π₯π¦, π sub π₯π₯, and π¦ bar and π₯ bar.

First, we recall π sub π₯π₯ is equal to the sum of π₯ squared minus the sum of π₯ all squared over π and π sub π₯π¦ is the sum of π₯ times π¦ minus the sum of π₯ times the sum of π¦ over π. Similarly, we know how to find the average value of π₯ and π¦. The mean value of π₯ will be the total of all of our data points of π₯ divided by the number of data points. Thatβs the sum of π₯ over π. Similarly, the mean value of π¦ will be the sum of π¦ over π.

Weβre now ready to start finding the equation of our regression line. However, thereβs a lot of things we need to take in. First, although this seems very complicated, there are only five things we need to find. We need to find the value of π, the sum of π₯, the sum of π¦, the sum of π₯ times π¦, and the sum of π₯ squared. Once weβve found these five values, we just need to substitute these into our formulae to find the values of π and π.

Weβll do these one at a time. Letβs start with the value of π. π is the number of data points. We can actually see this directly from our table. We can see that there are only six data points in this example. So our value of π is equal to six. We can also find the sum of π₯ and the sum of π¦ from our table. Letβs start with the sum of π₯. We just need to add all of the π₯-values in our table together. So in this case, the sum of π₯ is 10 plus 22 plus 22 plus 13 plus 16 plus 21. And we can calculate this. We see that itβs equal to 104.

And we can then do exactly the same thing to find the sum of π¦. We just want to add all of the values of π¦ in our table together. So in this case the sum of π¦ is going to be 25 plus 18 plus 24 plus 25 plus 12 plus 17. And then we can calculate this. We get that the sum of π¦ is equal to 121. This means weβve so far managed to find the values of π, the sum of π₯, and the sum of π¦. We have two more things we need to calculate. Next, letβs find the value of the sum of π₯ squared. To find the sum of π₯ squared, we need to square all of our values of π₯ in the table and then add these together. So in our table, we get the sum of π₯ squared is equal to 10 squared plus 22 squared plus 22 squared plus 13 squared plus 16 add 21 squared. And if we calculate this, we get 1934.

Thereβs only one more thing we need to calculate. We need to find the sum of π₯ multiplied by π¦. This is more tricky because we need to find the sum of π₯ multiplied by π¦ for each of the data points in our table. So letβs start with the first column in our table. The π₯-value is 10, and the π¦-value is 25. We need to multiply these together to get 10 times 25. We need to do the same with the second column in our table. The π₯-value is 22, and the π¦-value is 18. We need to multiply these together to get 22 times 18. And we need to add this to our previous product.

And we need to follow this process for all of the columns in our table, giving us the following expression for the sum of π₯π¦. And if we calculate this expression, we see we get the sum of π₯π¦ is equal to 2048. Now that we found the value of π, the sum of π₯, the sum of π¦, the sum of π₯ squared, and the sum of π₯ times π¦, weβre ready to find the values of π and π. And itβs worth pointing out we should always start with the value of π because we need the value of π to find the value of π. And of course to find the value of π, we first need to find π sub π₯π₯ and π sub π₯π¦.

Letβs start with π sub π₯π₯. First, we need the sum of π₯ squared. And we know this is equals to 1934. Then we need to subtract the sum of π₯ all squared divided by π. Remember the sum of π₯ is equal to 104. We then need to square this, and we need to divide this by the value of π, which is six. Therefore, weβve shown that π sub π₯π₯ is equal to 1934 minus 104 squared over six. And we can calculate this. Itβs equal to 394 divided by three. And itβs important we find this value exactly because we donβt want to round until the end because this might make our answer incorrect.

We can then do exactly the same to find π sub π₯π¦. We need to substitute in our values for the sum of π₯π¦, the sum of π₯, the sum of π¦, and π. Doing this, we get that π sub π₯π¦ is equal to 2048 minus 104 times 121 over six. And if we calculate this expression exactly, we get negative 148 divided by three. And now we can find the value of π. Remember, this is the quotient of these two values. π is equal to π sub π₯π¦ divided by π sub π₯π₯. So in this case, π is equal to negative 148 over three divided by 394 over three. And we could evaluate this by using our calculator. Or we could remember that to divide two fractions, we can also multiply it by the reciprocal of our second fraction.

Either way, we get our value of π is negative 74 divided by 197. And remember, itβs important to find this value exactly. Weβll round our values at the end. Weβre now ready to find the value of π, but letβs first clear some space. To find the value of π, we first need to find the mean value of π₯ and the mean value of π¦. Letβs start with the mean value of π₯. Thatβs the total value of π₯ divided by the number of data points, in this case, 104 over six. And in this case, we can cancel the shared factor of two in the numerator and denominator to get that π₯ bar is equal to 52 over three.

We can do the same to find the mean value of π¦. Thatβs the total value of π¦ divided by the number of data points, in this case, 121 over six. And this fraction doesnβt simplify any further. Weβre now ready to find the value of π. Remember π is equal to the mean value of π¦ minus π multiplied by the mean value of π₯. So in our case, π is going to be equal to 121 over six minus negative 74 over 197 multiplied by 52 over three. And we can simplify this expression. First, subtracting a negative number is the same as just adding a positive number. Next, we can simplify the second term in this expression by just multiplying the numerators and multiplying the denominators.

This gives us 121 over six plus 3848 divided by 591. And now we could find our value of π exactly as a fraction. However, itβs not necessary to answer this question since we only need to find the values of π and π to three decimal places. So weβll write this as an expansion. π is equal to 26.6776, and this expansion continues. We want to round this to three decimal places. So we need to look at the fourth decimal place in our expansion. This is equal to six, which is greater than or equal to five. So we need to round up. This gives us that π is equal to 26.678 to three decimal places.

We can do exactly the same with our value of π. We write out the value of π as a decimal expansion. We get negative 0.3756, and this expansion continues. We want this to three decimal places. So we need to look at the fourth decimal place. This is also equal to six. So weβre going to need to round up. So to three decimal places, our value of π is negative 0.376.

But weβre not done yet. Remember, the question wants us to give our answer in the equation of a line, π¦ hat is equal to π plus ππ₯. Substituting the values of π and π into this equation for a line and writing the π₯-term first, we get π¦ hat is equal to negative 0.376π₯ plus 26.678, which is our final answer. Therefore, in this question, we were able to find the least squares regression line between the variables π₯ and π¦. And we found the values of π and π to three decimal places. We got that π¦ hat will be equal to negative 0.376π₯ plus 26.678.