Your Name
27 October 2026
Predict a car's fuel efficiency in two clicks.
fit <- lm(mpg ~ wt + hp + am, data = mtcars)
round(summary(fit)$r.squared, 3)
[1] 0.84
round(coef(fit), 3)
(Intercept) wt hp am
34.003 -2.879 -0.037 2.084
Model explains this much of the variance in mpg (R-squared above).