Summary

This report is the final project of the Regression Models Course offered by Johns Hopkins University in the Coursera Plataform. The paper’s objective is to review a collection of cars and explore the relationship that explains quantitatively the miles per gallon spent. To do this will be used strategies of Exploratory Data Analysis and Regression Models.

Conclusions

As can be derived by the boxplot analysis of the data and the pattern with other variables showed before, automatic transmission tends to be better than manual transmissions for mpg. Analyzing the mpg trend just with the fact to be manual or automatic don’t show information with significant confidence.

So, mpg can be calculated as: mpg = 9.6175 + 2.9358\(*\)am - 3.9165\(*\)wt + 1.2259\(*\)qsec, where am = 0 for automatic transmission and 1 for manual transmission. Following the trend of the chosen model, the automatic transmission starts with 9.6178 for mpg and increases/decreases with wt and qsec values. Manual transmissions, on another side, have a start increased in 2.9358 mpg, so, starts with 12.5536 and changes the outcome by the values of qsec and wt.

Appendix

library(ggplot2)
library(dplyr)

mtcars$am <- if_else(mtcars$am == 0, true = "auto", false = "manual")

ggplot(mtcars) + 
  geom_boxplot(aes(x = am, y = mpg, group = am)) + 
  labs(x = "Transmission",
       y = "Milles per gallon (mpg)")
mpg X Transmission Boxplot

mpg X Transmission Boxplot

library(corrplot)
data("mtcars")

corrplot(cor(mtcars), 
         method = "color",
         type = "upper", 
         addCoef.col = TRUE,
         diag = FALSE,
         number.cex = 0.9)
Correlation Table

Correlation Table

par(mfrow = c(2,2))
plot(mult_fit)
Residuals plots (multivariable model)

Residuals plots (multivariable model)