8.1 Why one variable is not enough
The simple regression of grades on attendance was estimated precisely. What is missing?
Unit 7 ended with a simple regression of semester GPA on attendance.
students <- read.csv("data/attendance-grades.csv")
simple <- lm(sem_gpa ~ attendance, data = students)
round(coef(summary(simple)), 4)#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 1.562 0.2869 5.444 0
#> attendance 0.189 0.0107 17.589 0
The estimate is clear. Students who attend one additional class earn, on average, a semester GPA that is 0.189 points higher. The standard error is small, the confidence interval is narrow, and there is overwhelming evidence that attendance and grades are associated.
The question is whether this is the comparison we wanted to make.
Suppose we compare two students. One attended thirty classes and the other twenty. Their attendance differs by ten classes, but that is unlikely to be the only difference between them. The student who attended more may also have entered the semester better prepared, have stronger study habits, or simply be more academically able.
Our data contain measures of two such characteristics: each student’s cumulative GPA before the semester began, and their admission score.
#> attendance sem_gpa cum_gpa admission_score
#> attendance 1.000 0.560 0.427 -0.156
#> sem_gpa 0.560 1.000 0.653 0.246
#> cum_gpa 0.427 0.653 1.000 0.354
#> admission_score -0.156 0.246 0.354 1.000
One number immediately stands out. Attendance and prior GPA have a correlation of 0.43. Students who attend more classes also tend to have performed better before this semester even began.
Prior GPA, in turn, is strongly related to semester GPA.
So when the simple regression compares students with different attendance, it is also comparing students with different academic histories. Part of the estimated relationship may reflect attendance, and part may simply reflect the fact that students who were already performing well continue to do so.
This is exactly the problem discussed at the end of Unit 7. Variables that affect the outcome and move with attendance remain in the error term, and their influence becomes mixed with the coefficient on attendance.
The comparison we really want is more specific.
Instead of asking,
Do students who attend more classes earn higher grades?
we would like to ask,
Among students with the same prior GPA and the same admission score, do those who attend more classes earn higher grades?
That is a different comparison. We are no longer comparing every student with every other student. We are comparing students who are similar in their observed academic background and differ primarily in attendance.
Simple regression assumes that every relevant difference between students is either unrelated to attendance or hidden inside the error term. Multiple regression takes the first step towards relaxing that assumption by bringing some of those differences into the model.