Fuel Economy Explorer

Saathvik
September 2026

A clear, interactive MPG estimate from four familiar vehicle features

Built with R Shiny and the mtcars dataset

Why this app?

Car specifications are easy to find. Their combined effect is harder to judge.

  • Turns weight, horsepower, cylinders, and transmission into one readable estimate
  • Updates instantly, so users can explore trade-offs instead of reading a static table
  • Keeps the interaction approachable while showing honest model uncertainty

The experience is designed for a novice: describe a car, read the MPG estimate, then compare it with real observations.

From four inputs to one estimate

The server fits a multiple linear regression and evaluates it reactively:

fit <- lm(mpg ~ wt + hp + factor(cyl) + factor(am), data = mtcars)
round(c(R_squared = summary(fit)$r.squared,
        RMSE_MPG = sqrt(mean(residuals(fit)^2))), 2)
R_squared  RMSE_MPG 
     0.87      2.17 

The displayed values above are generated by R when this presentation is rendered.

What the user receives

More than a single prediction

  1. Estimated MPG — the model's central result
  2. 95% prediction interval — a realistic range for one vehicle
  3. Dataset comparison — distance above or below the mtcars average
  4. Nearest real profile — a recognizable reference vehicle

plot of chunk data-view

The same data provide immediate visual context inside the app.

Try the Explorer

Built to satisfy the assignment—and remain useful after grading

  • Multiple widgets drive a server-side calculation
  • Every result and chart responds immediately
  • Built-in guidance lets a first-time user begin without outside reading
  • A focused visual design makes comparisons quick and clear

Open the Shiny application, choose a vehicle profile, and explore what changes its fuel economy.

Source: github.com/ProfessorSad777/fuel-economy-explorer