The effect of automatic and manual transmissions on car consumption.

Executive summary

In this brief report we are interested in exploring the effect of different variables on car consumption (quanfied by the miles per gallon variable, MPG). Specifically, the main aim is to decide if having an automatic transmissions or not is better for MPG. The data was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).

Exploratory analysis

As first step we have seen if, by average, automatic and manual transmission cars do have different miles per gallon.

## Loading required package: ggplot2

plot of chunk unnamed-chunk-1

From this explaratory analysis it seems that having an automatic transmission is better for car consumption, resulting in an increase of about 7.2 miles per gallon as suggested by a simple linear model between MPG and Transmission (95% Confidence interval: 3.6415, 10.8484).

Multivariate analysis

In order to understand if our preliminary result is correct we should consider the other variables that are correlated with MPG, fitting multiple linear models; taking into account also that these variables could reverse the coefficient calculated in our exploratory analysis if are not homogenuously distributed between the automatic and manual transmission type.

First the relationships between variables was checked by plotting pairwise combination of them (see Appendix, figure 1). Variables that seemed more interesting (more correlated with MPG and Transmission) were used for fitting sequential linear models adding every time a new variable.

We performed anova on these models with the following results:

## Analysis of Variance Table
## 
## Model 1: mpg ~ factor(am)
## Model 2: mpg ~ factor(am) + wt
## Model 3: mpg ~ factor(am) + wt + factor(cyl)
## Model 4: mpg ~ factor(am) + wt + factor(cyl) + hp
## Model 5: mpg ~ factor(am) + wt + factor(cyl) + hp + factor(vs)
## Model 6: mpg ~ factor(am) + wt + factor(cyl) + hp + factor(vs) + disp
## Model 7: mpg ~ factor(am) + wt + factor(cyl) + hp + factor(vs) + disp + 
##     drat
##   Res.Df RSS Df Sum of Sq     F  Pr(>F)    
## 1     30 721                               
## 2     29 278  1       443 71.36 1.7e-08 ***
## 3     27 183  2        95  7.69  0.0028 ** 
## 4     26 151  1        32  5.15  0.0329 *  
## 5     25 144  1         7  1.18  0.2877    
## 6     24 143  1         1  0.10  0.7606    
## 7     23 143  1         0  0.07  0.7936    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The table is interpretable stating that adding the weight (wt) variable has a profound effect on the model, adding the cyl (number of cylinder) has a medium effect and adding the gross horsepower also results in significant change in the model.

As a matter of fact by simply adjusting for the weight the effect of the automatic transmission disappears with an expected change in MPG of just -0.02 (95% Confidence interval: -3.1848, 3.1376).

This is explained by the fact that the weight, the number of cylinders and the horsepower are all negative correlated with the MPG variables.

plot of chunk unnamed-chunk-5

Moreover heavier cars and cars with a higher number of cylinders, that consume more, have also a manual transmission, and so that could be the real reason we see that automatic transmission cars consume less.

Diagnostics

No pattern were found in residuals vs. fitted plot, values follow the theoretical quantile. See appendix, figure 2 for more details.

Results

Apparently, a car with an automatic transmission seems to consume less, being able to ride more miles per gallon. However, analysing the data better, it turns out that the majority of the cars that consume more, that are heavier, with a higher number of cylinders and a higher gross horsepower, have a manual transmission. Probably the main effect on consumption is due to the size and power of the car, rather than the transmission type.

Appendix

Figure 1

plot of chunk unnamed-chunk-6

Figure 2

plot of chunk unnamed-chunk-7