Consumer Reports wants to develop a regression model to predict mileage (mpg: mi
ID: 3049664 • Letter: C
Question
Consumer Reports wants to develop a regression model to predict mileage (mpg: miles driven per gallon) based on the horsepower of the car’s engine and the weight of the car (in pounds). Data were collected from a sample of 50 recent car models.
1) Interpret the meaning of the slope of the horsepower
2) Predict the miles per gallon for a car that have 60 horsepower and weigh 2000 pounds (4 points)
3) What % of the variation in MPG can be explained by variation in horsepower and variation in weight? (4 points)
4) Are horsepower and weight, taken together, have a significant relationship with mileage? Justify your answer with statistical evidence.
5) Does each variable, individually have a significant relationship with the mileage, and should be included in the model? Justify your answer with statistical evidence
MPG Horsepower Weight 43.1 48 1985 19.9 110 3365 19.2 105 3535 17.7 165 3445 18.1 139 3205 20.3 103 2830 21.5 115 3245 16.9 155 4360 15.5 142 4054 18.5 150 3940 27.2 71 3190 41.5 76 2144 46.6 65 2110 23.7 100 2420 27.2 84 2490 39.1 58 1755 28.0 88 2605 24.0 92 2865 20.2 139 3570 20.5 95 3155 28.0 90 2678 34.7 63 2215 36.1 66 1800 35.7 80 1915 20.2 85 2965 23.9 90 3420 29.9 65 2380 30.4 67 3250 36.0 74 1980 22.6 110 2800 36.4 67 2950 27.5 95 2560 33.7 75 2210 44.6 67 1850 32.9 100 2615 38.0 67 1965 24.2 120 2930 38.1 60 1968 39.4 70 2070 25.4 116 2900 31.3 75 2542 34.1 68 1985 34.0 88 2395 31.0 82 2720 27.4 80 2670 22.3 88 2890 28.0 79 2625 17.6 85 3465 34.4 65 3465 20.6 105 3380Explanation / Answer
Using R
> D=read.table(file.choose(),header=TRUE,sep=',')
> View(D)
> attach(D)
> names(D)
[1] "MPG" "Horsepower" "Weight"
> model=lm(MPG~Horsepower+Weight)
> model
Call:
lm(formula = MPG ~ Horsepower + Weight)
Coefficients:
(Intercept) Horsepower Weight
58.157082 -0.117525 -0.006871
so the regression model is
MPG=58.157082-0.117525*Horsepower - 0.006871*Weight
1) Interpret the meaning of the slope of the horsepower
--------> IF Horsepower increses 1 unit then MPG decreses -0.1175 unit this interprtetion of slope of the horsepower
2) Predict the miles per gallon for a car that have 60 horsepower and weight 2000 pounds (4 points)
MPG=58.157082-0.117525*Horsepower - 0.006871*Weight
=58.157082-0.117525*60 - 0.006871*2000
= 37.36358
3) What % of the variation in MPG can be explained by variation in horsepower and variation in weight? (4 points)
> R_square=summary(model)$r.squared
> R_square
[1] 0.7494169
so the 74 % of the variation in MPG can be explained by variation in horsepower and variation in weight.
4) Are horsepower and weight, taken together, have a significant relationship with mileage? Justify your answer with statistical evidence
> summary(model)
Call:
lm(formula = MPG ~ Horsepower + Weight)
Residuals:
Min 1Q Median 3Q Max
-7.596 -2.403 -0.518 2.565 10.579
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 58.157082 2.658248 21.878 < 2e-16 ***
Horsepower -0.117525 0.032643 -3.600 0.000763 ***
Weight -0.006871 0.001401 -4.903 1.16e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 4.177 on 47 degrees of freedom
Multiple R-squared: 0.7494, Adjusted R-squared: 0.7388
F-statistic: 70.28 on 2 and 47 DF, p-value: 7.505e-15
Comment - You can see above both the P-value which are less than 0.05 .so the both variable are significant.
5) Does each variable, individually have a significant relationship with the mileage, and should be included in the model? Justify your answer with statistical evidence.
-------> Yes both the variable are significant .
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.