Ben Anderson
6/20/2015
Ever wonder how much the weight of your cargo and passengers affects you miles per gallon?
With this shiny app, you can quickly calculate your new MPG!
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))
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
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.