Question Video: Finding the Equation of a Regression Line of a Regression Model | Nagwa Question Video: Finding the Equation of a Regression Line of a Regression Model | Nagwa

Question Video: Finding the Equation of a Regression Line of a Regression Model Mathematics • Third Year of Secondary School

Join Nagwa Classes

Attend live Mathematics sessions on Nagwa Classes to learn more about this topic from an expert teacher!

The table shows the price of a barrel of oil and the economic growth. Using the information in the table, find the regression line 𝑦 hat equals π‘Ž plus 𝑏π‘₯. Round π‘Ž and 𝑏 to 3 decimal places.

07:16

Video Transcript

The table shows the price of a barrel of oil and the economic growth. Using the information in the table, find the regression line 𝑦 hat equals π‘Ž plus 𝑏π‘₯. Round π‘Ž and 𝑏 to three decimal places.

We want to find a line in the form 𝑦 hat equals π‘Ž plus 𝑏π‘₯. To solve for this line, we’re going to use the least squares regression line method, where 𝑦 hat equals π‘Ž plus 𝑏π‘₯, where 𝑏 is equal to 𝑁 times the sum of π‘₯𝑦 minus the sum of π‘₯ times the sum of 𝑦 all over 𝑁 times the sum of π‘₯ squared minus the sum of π‘₯ squared and π‘Ž is equal to the sum of 𝑦 minus 𝑏 times the sum of π‘₯ all over 𝑁 and 𝑁 equals the number of data points.

Practically, the best way to solve this is by separately finding each of these summations before we try to calculate π‘Ž and 𝑏. We’ll need the sum of π‘₯, the sum of 𝑦, the sum of π‘₯ times 𝑦, and the sum of π‘₯ squared for every data point. Before we can go about doing this, we need to label which of these rows is the π‘₯ and which row is the 𝑦. Remember, we need the π‘₯ to be the independent variable and 𝑦 to be the dependent variable. In this case, we’re comparing the price of a barrel of oil in dollars to the economic growth rate.

The price of one barrel of oil in dollars is the independent variable. And we want to measure the output of economic growth based on the price of oil. And so the first step we can do is sum all of our π‘₯-values and then sum all of our 𝑦-values. When we take every data point from our π‘₯-row and add them together, we get 637.60. Doing the same thing for 𝑦, when we total all of the economic growth rates from all eight data points, we get 17.6. This means we have a value for the sum of π‘₯ and the sum of 𝑦. Now we should move on and try and figure out what the sum of π‘₯ squared would be.

Before we can find the sum of π‘₯ squared, we have to square every π‘₯-value, starting with the first value 50.40 squared, which is 2540.16. The second data point 55.30 squared equals 3058.09. We need to do this for every data point. Once we’ve squared all eight of our π‘₯-values, we can add them together, which gives us 54,839.76. Now that we have the sum of the π‘₯ squared values, we need to calculate the sum of π‘₯ times 𝑦. And this means that for every coordinate pair, we need to multiply π‘₯ by 𝑦.

Beginning with the first column, 50.40 times negative one equals negative 50.40. And then we have 55.30 time 0.5, which gives us 27.65. We need to continue this pattern for all eight of our data pairs. Once we have all eight values for π‘₯ times 𝑦, we add them together, which gives us 1772.77. And that means we have our last sum. And we can begin solving for π‘Ž and 𝑏. To do that, we recognize that our 𝑁 equals eight; we have eight data points. And 𝑏 will be equal to eight times the sum of π‘₯ times 𝑦.

Now, when we go to subtract the sum of π‘₯ times the sum of 𝑦, we should be careful. We need to plug in the sum of all the π‘₯-values, 637.60, which is being multiplied by the sum of all the 𝑦-values, 17.6. All of this is going to be over eight times the sum of π‘₯ squared. Because the π‘₯ squared value is in the parentheses, the sum of π‘₯ squared is the value that sums every π‘₯-coordinate squared, for us, 54,839.76.

In this final term, we have the sum of π‘₯ all being squared, indicated by the fact that the sum of π‘₯ is in the parentheses and the square is on the outside, which means we need 637.60 squared. You want to enter all of this on your calculator very carefully, making sure that you group the numerator and the denominator to get an accurate result. Alternatively, you could separately calculate the numerator and the denominator and then divide.

If we’ve entered everything correctly, we get a value of 𝑏 equal to 0.0919826 continuing. And when we round to the third decimal place, we look to the right where there is a nine, which tells us we’ll round our 𝑏-value up to 0.092. Moving on to our π‘Ž-value, we take the sum of our 𝑦-values, 17.6, subtract what we found for our 𝑏-values, 0.092, multiplied by the sum of our π‘₯-values, 637.6, and divide by 𝑁, which in our case is eight. Again, if you’re going to enter this into your calculator all at once, you need to group the numerator and the denominator or calculate the numerator first and then divide by eight.

When we do that, we get negative 5.1324. When rounded to the third decimal place, we can say that π‘Ž is equal to negative 5.132, which means that 𝑦 hat is equal to negative 5.132 plus 0.092π‘₯, which we could also write as 𝑦 hat is equal to 0.092π‘₯ minus 5.132. Solving for the least squares regression line is not difficult using this method. However, it does require you to be very accurate at each stage. You wanna make sure that all of your π‘₯ squared values are accurate, all of your π‘₯ times 𝑦 values are accurate, and then all of your sums are accurate. After that, you can carefully enter all of those values into the formulas for π‘Ž and 𝑏.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

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