2026-06-04

Slide 1 — Title

Car MPG Predictor

Interactive Shiny Application

Created: 2026-06-04

Slide 2 — Problem

Why This App?

Fuel efficiency is an important factor when selecting vehicles.

This application estimates vehicle MPG using:

  • Vehicle Weight
  • Horsepower

Users interact using sliders.

Slide 3 — How It Works

Application Logic

Prediction Model:

model <- lm(mpg ~ wt + hp, data=mtcars)

summary(model)
## 
## Call:
## lm(formula = mpg ~ wt + hp, data = mtcars)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.941 -1.600 -0.182  1.050  5.854 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 37.22727    1.59879  23.285  < 2e-16 ***
## wt          -3.87783    0.63273  -6.129 1.12e-06 ***
## hp          -0.03177    0.00903  -3.519  0.00145 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.593 on 29 degrees of freedom
## Multiple R-squared:  0.8268, Adjusted R-squared:  0.8148 
## F-statistic: 69.21 on 2 and 29 DF,  p-value: 9.109e-12

Inputs: - Weight

  • Horsepower

Output: - Predicted MPG

Slide 4 — Example Prediction

Example

model <- lm(mpg~wt+hp,data=mtcars)

predict(
model,
newdata=data.frame(
wt=3,
hp=150
)
)
##        1 
## 20.82784

This demonstrates the server calculation.

Slide 5 — Conclusion

Conclusion

Features:

✓ Interactive controls

✓ Reactive calculations

✓ Visualization

✓ Beginner-friendly design