2026-06-04
Interactive Shiny Application
Created: 2026-06-04
Fuel efficiency is an important factor when selecting vehicles.
This application estimates vehicle MPG using:
Users interact using sliders.
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
Output: - Predicted MPG
model <- lm(mpg~wt+hp,data=mtcars) predict( model, newdata=data.frame( wt=3, hp=150 ) )
## 1 ## 20.82784
This demonstrates the server calculation.
Features:
✓ Interactive controls
✓ Reactive calculations
✓ Visualization
✓ Beginner-friendly design