Javier Carrasco
September 06, 2017
Explore the factors that influence fuel efficiency in cars using the Motor
Trend data for 1973 and 1974 models available on the R dataset mtcars.
In particular answer the following questions:
Best Linear Regression Model for MPG:
model <- train(mpg~.,mtcars,method="lmStepAIC",direction="both",trace=F)
summary(model)$coef
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.617781 6.9595930 1.381946 1.779152e-01
wt -3.916504 0.7112016 -5.506882 6.952711e-06
qsec 1.225886 0.2886696 4.246676 2.161737e-04
amManual 2.935837 1.4109045 2.080819 4.671551e-02
Diagnostic plots suggest residuals are normaly distributed and they are not correlated with the outcome variable.
Linear regression model shows: