Your Name
2026-05-19
This project presents a Shiny application called Car MPG Predictor.
The app predicts car fuel efficiency using the mtcars dataset.
Main features:
Users can change:
The prediction updates automatically.
model <- lm(mpg ~ wt + hp + cyl + am, data = mtcars)
summary(model)
Call:
lm(formula = mpg ~ wt + hp + cyl + am, data = mtcars)
Residuals:
Min 1Q Median 3Q Max
-3.4765 -1.8471 -0.5544 1.2758 5.6608
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 36.14654 3.10478 11.642 4.94e-12 ***
wt -2.60648 0.91984 -2.834 0.0086 **
hp -0.02495 0.01365 -1.828 0.0786 .
cyl -0.74516 0.58279 -1.279 0.2119
am 1.47805 1.44115 1.026 0.3142
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.509 on 27 degrees of freedom
Multiple R-squared: 0.849, Adjusted R-squared: 0.8267
F-statistic: 37.96 on 4 and 27 DF, p-value: 1.025e-10
model <- lm(mpg ~ wt + hp + cyl + am, data = mtcars)
newdata <- data.frame(
wt = 3,
hp = 120,
cyl = 4,
am = 1
)
predict(model, newdata)
1
23.83039
The application demonstrates:
This project was developed using Shiny and RStudio.