Developing Data Products | Course Project
November 3, 2026
Choose a vehicle profile. Compare transmissions. Question the prediction.
Built with the 32 cars in R's mtcars dataset.
FuelLens / MPG Studio
The following R code is evaluated when the presentation is rendered:
with(mtcars, tapply(mpg, factor(am, levels=c(0,1),
labels=c("Automatic", "Manual")), mean))
Automatic Manual
17.14737 24.39231
Reactive chain: input sliders -> reactive() vehicle data -> predict() -> renderUI() / renderPlot().
model <- lm(mpg ~ wt + hp + factor(am), data = mtcars)
round(coef(model), 2)
(Intercept) wt hp factor(am)1
34.00 -2.88 -0.04 2.08
2.5 % 97.5 %
factor(am)1 -0.7357587 4.903179
The coefficient for factor(am)1 is an adjusted association (manual versus automatic at equal weight and horsepower); it is not causal evidence.
shiny), no API credentials.round(summary(lm(mpg ~ wt + hp + factor(am), data=mtcars))$r.squared, 3)
[1] 0.84
Visit the live Shiny application via the separate URL submitted in Coursera.
Source: R mtcars (1974 Motor Trend road-test observations).