Chapter 4 Simple Linear Regression

In this chapter, you will learn how to:

  • Write and interpret a simple linear regression equation;
  • Fit and visualize a simple linear regression model;
  • Interpret the estimated regression coefficients for a model with a continuous predictor;
  • Interpret the estimated regression coefficients for a model with a categorical predictor;
  • Test the significance of a single regression coefficient;
  • Use a multiple degree of freedom test to test the significance of multiple coefficients simultaneously;
  • Compute predictions from the model;
  • Compute confidence intervals for the regression coefficients;
  • Compute and visualize confidence intervals for the mean outcome;
  • Compute and visualize confidence intervals for individual observations; and
  • Fit and visualize a curve using a polynomial function.

Some of the R programming code used in this chapter uses elements of the tidyverse library (Hadley Wickham 2023), in particular the pipe operator %>% and functions such as mutate(). Load this library before proceeding.

library(tidyverse)

References

———. 2023. Tidyverse: Easily Install and Load the Tidyverse. https://tidyverse.tidyverse.org.