January 2026

1. Project Introduction

This Shiny application is a decision-support tool for car buyers.

  • Problem: Understanding fuel efficiency across different weights and power levels.
  • Solution: A reactive application that predicts MPG using a linear regression model.
  • Reliability: Uses the industry-standard mtcars dataset.

2. Dataset Analysis

The model relies on the built-in mtcars dataset. Below is a live summary of the key variables used for our prediction:

3. Model

A linear regression model is used to predict MPG. 𝑀𝑃𝐺=𝛽0+𝛽1(𝑤𝑡)+𝛽2(ℎ𝑝)MPG=β0​+β1​(wt)+β2​(hp)

4. Implementation

The model is trained using the following R code. fit <- lm(mpg ~ wt + hp, data = mtcars) coef(fit)

##5. Conclusion The Car MPG Predictor allows users to: Adjust inputs interactively Instantly view predicted MPG Understand the impact of weight and horsepower

summary(mtcars[, c("mpg", "wt", "hp")])
##       mpg              wt              hp       
##  Min.   :10.40   Min.   :1.513   Min.   : 52.0  
##  1st Qu.:15.43   1st Qu.:2.581   1st Qu.: 96.5  
##  Median :19.20   Median :3.325   Median :123.0  
##  Mean   :20.09   Mean   :3.217   Mean   :146.7  
##  3rd Qu.:22.80   3rd Qu.:3.610   3rd Qu.:180.0  
##  Max.   :33.90   Max.   :5.424   Max.   :335.0
fit <- lm(mpg ~ wt + hp, data = mtcars)
coef(fit)
## (Intercept)          wt          hp 
## 37.22727012 -3.87783074 -0.03177295