an engineer wants to determine how the weight of a gas - powered car, x, affects gas mileage, y. the…

an engineer wants to determine how the weight of a gas - powered car, x, affects gas mileage, y. the accompanying data represent the weights of various domestic cars and their miles per gallon in the city for the most recent model year. complete parts (a) through (d) below.\nclick here to view the weight and gas mileage data.\n(a) find the least - squares regression line treating weight as the explanatory variable and miles per gallon as the response variable.\n\\(\\hat{y}=\\square x+(\\square)\\)\n(round the x coefficient to five decimal places as needed. round the constant to one decimal place as needed.)\ncar weight and mpg\nweight (pounds), x miles per gallon, y\n3729 18\n3912 16\n2772 24\n3522 18\n3292 21\n2998 22\n3758 18\n2514 23\n3566 20\n3812 17
Answer
Explanation:
Step1: Calculate sums
Let $n = 10$ (number of data - points). Calculate $\sum_{i = 1}^{n}x_{i}=3729 + 3912+2772+3522+3292+2998+3758+2514+3566+3812 = 33875$. Calculate $\sum_{i = 1}^{n}y_{i}=18 + 16+24+18+21+22+18+23+20+17 = 197$. Calculate $\sum_{i = 1}^{n}x_{i}^{2}=3729^{2}+3912^{2}+2772^{2}+3522^{2}+3292^{2}+2998^{2}+3758^{2}+2514^{2}+3566^{2}+3812^{2}=115734325$. Calculate $\sum_{i = 1}^{n}x_{i}y_{i}=3729\times18 + 3912\times16+2772\times24+3522\times18+3292\times21+2998\times22+3758\times18+2514\times23+3566\times20+3812\times17=659999$.
Step2: Calculate slope $b_1$
The formula for the slope $b_1$ of the least - squares regression line is $b_1=\frac{n\sum_{i = 1}^{n}x_{i}y_{i}-\sum_{i = 1}^{n}x_{i}\sum_{i = 1}^{n}y_{i}}{n\sum_{i = 1}^{n}x_{i}^{2}-(\sum_{i = 1}^{n}x_{i})^{2}}$. Substitute the values: [ \begin{align*} b_1&=\frac{10\times659999 - 33875\times197}{10\times115734325-(33875)^{2}}\ &=\frac{6599990-6673375}{1157343250 - 1147525625}\ &=\frac{-73385}{9817625}\ &\approx - 0.00748 \end{align*} ]
Step3: Calculate intercept $b_0$
The formula for the intercept $b_0$ is $b_0=\bar{y}-b_1\bar{x}$, where $\bar{x}=\frac{\sum_{i = 1}^{n}x_{i}}{n}=\frac{33875}{10}=3387.5$ and $\bar{y}=\frac{\sum_{i = 1}^{n}y_{i}}{n}=\frac{197}{10}=19.7$. [ \begin{align*} b_0&=19.7-(-0.00748)\times3387.5\ &=19.7 + 25.3485\ &\approx45.0 \end{align*} ]
Answer:
$\hat{y}=- 0.00748x + 45.0$