Sujal
October 2026
A Shiny app that predicts a car's mileage from its weight, horsepower and transmission.
Developing Data Products — Course Project
Our idea: turn those three easy-to-find numbers into an instant mileage estimate, with no statistics knowledge needed.
The app fits a linear regression on R's built-in mtcars dataset (32 cars):
fit <- lm(mpg ~ wt + hp + am, data = mtcars)
round(coef(fit), 3)
(Intercept) wt hp am
34.003 -2.879 -0.037 2.084
A 3000 lb, 120 hp car with a manual gearbox:
car <- data.frame(wt = 3.0, hp = 120, am = 1)
round(predict(fit, car, interval = "prediction"), 1)
fit lwr upr
1 23 17.4 28.5
Using the app takes three steps: 1. Move the weight and horsepower sliders. 2. Choose Automatic or Manual transmission. 3. Read the predicted MPG, km/l and 95% range — updated instantly, with a plot.
A built-in “How to use” tab explains everything for first-time users.