The Effect of Additional Weight on MPG

Ben Anderson
6/20/2015

Project Impetus

Ever wonder how much the weight of your cargo and passengers affects you miles per gallon?

alt text

With this shiny app, you can quickly calculate your new MPG!

Background

Using the mtcars data set, I used a linear model to determine the effect of weight on MPG.

plot(mpg~wt, data=mtcars)
abline(lm(mpg~wt,data=mtcars))

plot of chunk unnamed-chunk-1

Calculation

Since the weights of the cars are in tons, I converted to lbs.

finalMPG = initialMPG - 0.002672 * addedWeight

lm(mpg~wt,data=mtcars)

Call:
lm(formula = mpg ~ wt, data = mtcars)

Coefficients:
(Intercept)           wt  
     37.285       -5.344  

shiny app

By simply entering your car's EPA MPG estimate and the weight added to the car and clicking submit, you are presented with your car's estimated fuel economy. alt text

app link