January 22, 2026

Project Overview: Problem & Solution

The Problem: Fuel Cost Uncertainty Planning a road trip involves guesswork regarding efficiency and expenses. Gas prices fluctuate, and vehicle specs (weight/HP) significantly impact MPG.

The Solution: A Reactive Shiny App Our application bridges the gap between technical data and financial planning.

  • Predictive Power : Uses linear regression to estimate MPG.
  • Instant Calcs : Factors in distance and price for a total cost estimate.
  • User-Friendly : Built with a professional ‘Flatly’ interface.

Data Science & Model Analysis

The app is powered by the mtcars dataset. Below is the relationship between Horsepower and MPG that informs our predictive algorithm:

## `geom_smooth()` using formula = 'y ~ x'

Summary of MPG data used: Min.: 10.4 | 1st Qu.: 15.425 | Median: 19.2 | Mean: 20.090625 | 3rd Qu.: 22.8 | Max.: 33.9

Technical Implementation

The algorithm calculates predicted MPG using these industry coefficients derived from our regression model:

fit <- lm(mpg ~ hp + wt, data = mtcars)
coef(fit)
## (Intercept)          hp          wt 
## 37.22727012 -0.03177295 -3.87783074

The red line in the app’s visualization represents your specific vehicle’s prediction relative to the historical dataset, providing a clear performance benchmark.

Experience it Now

The application is fully deployed on ShinyApps.io and the source code is available on GitHub.

Created for the Johns Hopkins Data Science Specialization.