2025-09-20

The old way - inaccurate and too simple!

The R-squared for this tired and overly simple model is

model1 <- lm(hp ~ mpg, data = mtcars)
round(summary(model1)$r.squared, 3)
## [1] 0.602

As we can see, MPG is a great predictor of horsepower. But, mtcars has so many other features for us to take advantage of!

The new and improved approach

modelNew <- lm(hp ~ mpg + disp + cyl, data = mtcars)

The R-squared for our new model is: 0.712. By using more data, we’ve significantly improved the model’s predictive power.

Model Performance Comparison

Model R-squared Adjusted R-squared
Old (MPG) 0.602 0.589
New (MPG, Disp, Cyl) 0.712 0.681

As we can see, our new model’s R-squared value is much higher, which means it explains a much larger proportion of the variation in horsepower.

Conclusion

Our new model is awesome and you should check out the ahem “shiny” new web app we’ve built to show it off. Click here NOW!

Shiny logo

Author’s Notes

Obviously this was all written in jest and I’m just having fun. And as we all know - using more predictors isn’t actually always better. If we can, we should “keep it simple!”. Cheers!

Happy Face