Video: Calculating the Equation of the Least Squares Regression Line

The scatterplot shows a set of data for which a linear regression model appears appropriate. The data used to produce the scatterplot is given in the table shown. Calculate the equation of the least squares regression line of 𝑦 on π‘₯, rounding the regression coefficients to the nearest thousandth.

03:13

Video Transcript

The scatterplot shows a set of data for which a linear regression model appears appropriate. The data used to produce the scatterplot is given in the table shown. Calculate the equation of the least squares regression line of 𝑦 on π‘₯, rounding the regression coefficients to the nearest thousandth.

Essentially, linear regression is a single independent variable that’s used to predict the value of a dependent variable. So this line will help predict the dependent variable. The equation of this line is 𝑦 equals π‘Ž plus 𝑏π‘₯, where π‘Ž is equal to 𝑦 minus 𝑏π‘₯, where 𝑦 is the mean 𝑦 value and π‘₯ is the mean π‘₯ value. And 𝑏 is equal to Sπ‘₯𝑦 divided by Sπ‘₯π‘₯. Sπ‘₯𝑦 is the covariance of π‘₯ and 𝑦 divided by 𝑛 and Sπ‘₯π‘₯ is a variance of π‘₯ divided by 𝑛.

The formulas for these, Sπ‘₯𝑦 is equal to the sum of π‘₯ times 𝑦s minus the sum of π‘₯ times the sum of 𝑦 divided by 𝑛 and then Sπ‘₯π‘₯ is equal to the sum of π‘₯ squareds minus the sum of the π‘₯s squared divided by 𝑛. Let’s go ahead and make a table of everything we need to find. Let’s first begin by finding 𝑏. Here are our formulas. So if we take all our π‘₯s and we square them, we have these answers. And if we take π‘₯ times 𝑦, we have these answers. And if we would find the sum of each column, we have these: 18, 45.1, 51, and 78.05.

18 is the sum of the π‘₯s. 45.1 is the sum of the 𝑦s. 51 is the sum of the π‘₯ squares and 78.05 is the sum of π‘₯ times 𝑦s. And now we’ve plugged them in correctly. After multiplying and dividing, we have 78.05 minus 101.475 divided by 51 minus 40.5, which is equal to negative 23.475 divided by 10 and a half which equals negative 2.236. This is the value of 𝑏.

So for our equation, 𝑦 equals π‘Ž plus 𝑏π‘₯, we have 𝑦 equals π‘Ž minus 2.236π‘₯. So now we need to find π‘Ž. π‘Ž was equal to the mean value of 𝑦 minus 𝑏 times the mean value of π‘₯. To find the mean, you take the sum and divide by, in this case, eight since there’s eight π‘₯s and eight 𝑦s. After plugging in, this results in 10.669. Therefore, the equation of the least squares regression line of 𝑦 on π‘₯ will be 𝑦 equals 10.669 minus 2.236π‘₯.

Now remember, depending on how you rounded, for example, when you found the π‘₯ times 𝑦s, we rounded three decimal places right away. So therefore, keep in mind that your final answer maybe just a little bit different depending on how far you rounded throughout your work.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.