Shruthi R
October 28, 2026
A simple interactive Shiny application for exploring and predicting automobile fuel economy.
Live application: https://shruthi1232131231.shinyapps.io/mpg_predictor/
Source code: https://github.com/ShruthiRmit/Car-MPG-Explorer-Predictor
Fuel economy depends on several vehicle characteristics, so a single-variable comparison can be misleading.
The Car MPG Explorer & Predictor lets a user choose:
The app then estimates MPG instantly and explains the result in plain language.
It turns a regression model into something a novice can explore without writing any R code.
The Shiny server fits a multiple linear regression model to R's built-in mtcars data.
cars <- mtcars
cars$am <- factor(cars$am, levels = c(0, 1),
labels = c("Automatic", "Manual"))
cars$cyl <- factor(cars$cyl)
fit <- lm(mpg ~ wt + hp + am + cyl, data = cars)
round(summary(fit)$r.squared, 3)
[1] 0.866
The R code above is evaluated when this presentation is rendered.
A higher R-squared indicates that the selected vehicle characteristics explain a substantial share of MPG variation in this small dataset.
The user changes sliders and selectors for weight, horsepower, cylinders, and transmission.
Every change triggers a new server-side prediction.
The application displays:
The app also includes a dedicated How to Use tab so the documentation is available directly on the Shiny site.
Shiny app: https://shruthi1232131231.shinyapps.io/mpg_predictor/
GitHub code: https://github.com/ShruthiRmit/Car-MPG-Explorer-Predictor
The project demonstrates how statistical modeling, reactivity, and user-centered design can be combined in a compact data product.