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

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