Anand Venukrishnan
October 2026
A Shiny app that predicts a car's MPG from weight, horsepower and transmission
The Fuel Economy Predictor turns three easy inputs into an MPG estimate with an uncertainty range.
Linear regression on R's built-in mtcars data:
fit <- lm(mpg ~ wt + hp + am, data = mtcars)
round(coef(fit), 3)
(Intercept) wt hp am
34.003 -2.879 -0.037 2.084
round(summary(fit)$r.squared, 3)
[1] 0.84
The three inputs explain about 84% of the variation in MPG.
A 3,200 lb automatic car with 140 hp:
fit lwr upr
1 19.5 14.1 24.9
The app shows this instantly and redraws as you move the sliders.