2 Simple linear regression in action

 

This chapter covers

  • Recognizing a linear relationship
  • Fitting a line to data
  • Understanding the theory behind simple linear regression
  • Using, assessing, and interpreting a simple linear regression model

Regression analysis began in the last half of the 19th century, when Victorians became obsessed with quantifying things and applying the scientific method to everything in sight; since people were easy to find and measure, much of the data that drove the development of regression consisted of body measurements. Heights of parents and their children played an especially prominent role in early regression analyses, so it seems fitting to use one such dataset for our first example in Section 1. (Pun intended! Trust me, this is funny.) We’ll see that linear relationships in data can sometimes be found and analyzed directly, without relying on models. In other cases, we need to build statistical models to learn as much as we can from our data. With that in mind, the main goal of this chapter is to explain how to construct and use simple linear regression models to understand relationships between quantitative variables.

As you work through the chapter, open a new Jupyter notebook for each example. In the first cell, import the libraries we’ll be using:

2.1 The line of averages

2.2 Fitting a line to data

2.2.1 The correlation coefficient

2.2.2 The null model

2.2.3 Fitting and assessing the regression line

2.2.4 Using and interpreting the regression line

2.3 Examples

2.3.1 Understanding the compressive strength of concrete

2.3.2 Imputing fish weights

2.3.3 Predicting college enrollments

2.4 Exercises

2.5 Summary

sitemap