Dmitry Yudkin
Saturday, August 23, 2014
In this report, we're going to respond on two questions, which will allow to select proper transmission type for a most efficient car, in terms of miles-per-gallon:
The latest regression model from the section below - has all important variables as confounders - and shown us almost 2 miles more per gallon in case of automatic transmission. So, cars with auto transmission more efficient in MPG aspect, than manual transmission cars - considering equal weight & horsepower of the car (all other properties highly correlated with these two, or transmission type itself).
mpg <- mtcars$mpg
trans_type <- factor(mtcars$am)
weight <- mtcars$wt
horsepower <- mtcars$hp
regression_model2 <- lm(mpg ~ trans_type + weight + horsepower - 1)
Call:
lm(formula = mpg ~ trans_type + weight + horsepower - 1)
Residuals:
Min 1Q Median 3Q Max
-3.422 -1.792 -0.379 1.225 5.532
Coefficients:
Estimate Std. Error t value Pr(>|t|)
trans_type0 34.00288 2.64266 12.87 2.8e-13 ***
trans_type1 36.08659 1.73634 20.78 < 2e-16 ***
weight -2.87858 0.90497 -3.18 0.00357 **
horsepower -0.03748 0.00961 -3.90 0.00055 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.54 on 28 degrees of freedom
Multiple R-squared: 0.987, Adjusted R-squared: 0.985
F-statistic: 538 on 4 and 28 DF, p-value: <2e-16