Compute the least-squares regression equation for the given data set. Round the slope and intercept to at least 4 decimal places.

x: 42, 36, 14, 18, 23, 36, 17
y: 71, 66, 24, 28, 41, 64, 31

Regression line equation: ^y=?

1 answer

To compute the least-squares regression equation for the given data set, we need to use the formula for the slope (b) and the intercept (a) of the regression line, which follows the equation:

\[ \hat{y} = a + bx \]

Step 1: Gather Data

We have:

  • \( x: [42, 36, 14, 18, 23, 36, 17] \)
  • \( y: [71, 66, 24, 28, 41, 64, 31] \)

Step 2: Calculate Averages

Calculate the means of \( x \) and \( y \):

\[ \bar{x} = \frac{42 + 36 + 14 + 18 + 23 + 36 + 17}{7} = \frac{ 42 + 36 + 14 + 18 + 23 + 36 + 17 }{7} = \frac{ 186 }{7} \approx 26.5714 \]

\[ \bar{y} = \frac{71 + 66 + 24 + 28 + 41 + 64 + 31}{7} = \frac{ 71 + 66 + 24 + 28 + 41 + 64 + 31 }{7} = \frac{ 325 }{7} \approx 46.4286 \]

Step 3: Calculate the Slope (b)

The slope (b) is calculated using the formula:

\[ b = \frac{\sum{(x_i - \bar{x})(y_i - \bar{y})}}{\sum{(x_i - \bar{x})^2}} \]

Compute necessary sums:

  1. Calculate \( \sum{(x_i - \bar{x})(y_i - \bar{y})} \):

    • For each \( i \):

      • \( x_1 = 42, y_1 = 71 \Rightarrow (42-26.5714)(71-46.4286) = 15.4286 \cdot 24.5714 \approx 379.6327 \)
      • \( x_2 = 36, y_2 = 66 \Rightarrow (36-26.5714)(66-46.4286) = 9.4286 \cdot 19.5714 \approx 184.0324 \)
      • \( x_3 = 14, y_3 = 24 \Rightarrow (14-26.5714)(24-46.4286) = -12.5714 \cdot -22.4286 \approx 282.2954 \)
      • \( x_4 = 18, y_4 = 28 \Rightarrow (18-26.5714)(28-46.4286) = -8.5714 \cdot -18.4286 \approx 157.7557 \)
      • \( x_5 = 23, y_5 = 41 \Rightarrow (23-26.5714)(41-46.4286) = -3.5714 \cdot -5.4286 \approx 19.3857 \)
      • \( x_6 = 36, y_6 = 64 \Rightarrow (36-26.5714)(64-46.4286) = 9.4286 \cdot 17.5714 \approx 165.6286 \)
      • \( x_7 = 17, y_7 = 31 \Rightarrow (17-26.5714)(31-46.4286) = -9.5714 \cdot -15.4286 \approx 147.1745 \)
    • Summing these values gives: \[ \sum{(x_i - \bar{x})(y_i - \bar{y})} \approx 379.6327 + 184.0324 + 282.2954 + 157.7557 + 19.3857 + 165.6286 + 147.1745 \approx 1035.1040 \]

  2. Calculate \( \sum{(x_i - \bar{x})^2} \):

    • For each \( x_i \):

      • \( x_1 = 42 \Rightarrow (42-26.5714)^2 \approx 241.0816 \)
      • \( x_2 = 36 \Rightarrow (36-26.5714)^2 \approx 88.1633 \)
      • \( x_3 = 14 \Rightarrow (14-26.5714)^2 \approx 157.7557 \)
      • \( x_4 = 18 \Rightarrow (18-26.5714)^2 \approx 73.4694 \)
      • \( x_5 = 23 \Rightarrow (23-26.5714)^2 \approx 12.2449 \)
      • \( x_6 = 36 \Rightarrow (36-26.5714)^2 \approx 88.1633 \)
      • \( x_7 = 17 \Rightarrow (17-26.5714)^2 \approx 91.7556 \)
    • Summing these values gives: \[ \sum{(x_i - \bar{x})^2} \approx 241.0816 + 88.1633 + 157.7557 + 73.4694 + 12.2449 + 88.1633 + 91.7556 \approx 652.5551 \]

Now, substituting back into the slope equation: \[ b = \frac{1035.1040}{652.5551} \approx 1.5857 \]

Step 4: Calculate the Intercept (a)

The intercept (a) can be calculated using:

\[ a = \bar{y} - b\bar{x} \]

Substituting the known values: \[ a = 46.4286 - 1.5857 \cdot 26.5714 \approx 46.4286 - 42.0459 \approx 4.3827 \]

Step 5: Write the Regression Line Equation

Now we can write the least-squares regression equation:

\[ \hat{y} = 4.3827 + 1.5857x \]

Final Answer

To summarize, the least-squares regression equation for the given data set is:

\[ \hat{y} = 4.3827 + 1.5857x \]