2025-05-18

🚀 Welcome to MPG Predictor

Built with R + Shiny

A fast, user-friendly app that estimates fuel efficiency using car specs.

The Problem

  • Car buyers want to understand how weight and horsepower affect MPG.
  • Manufacturer estimates are often oversimplified.
  • We need an interactive, data-driven tool for accurate predictions.
##                   mpg  wt  hp
## Mazda RX4          21 2.6 110
## Mazda RX4 Wag      21 2.9 110
## Datsun 710         23 2.3  93
## Hornet 4 Drive     21 3.2 110
## Hornet Sportabout  19 3.4 175
## Valiant            18 3.5 105

The Solution - shiny MPG Predictor

  • Built with R + Shiny
  • Uses a linear model on mtcars
  • Predicts MPG using Weight and Horsepower
  • Fully interactive, easy to use
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept)   37.227      1.599    23.3  2.6e-20
## wt            -3.878      0.633    -6.1  1.1e-06
## hp            -0.032      0.009    -3.5  1.5e-03

Features & Predicted Output

## [1] "Predicted MPG for wt = 3.2 & hp = 110 is: 21.32"
## Warning: Failed to fit group -1.
## Caused by error:
## ! object 'hp' not found

Try it yourself