This is the output from a linear regression model that is trying to predict math scores based on the student's gender and whether or not they took a test preparation course. It is just a toy example for me to understand how to interpret the coefficients.
> str(StudentsPerformance)
'data.frame': 1000 obs. of 8 variables:
$ gender : chr "female" "female" "female" "male" ...
$ test.preparation.course : chr "none" "completed" "none" "none" ...
$ math.score : int 72 69 90 47 76 71 88 40 64 38 ...
The model includes an interaction term between gender and test preparation course.
lm(formula = math.score ~ 1 + gender * test.preparation.course, data = StudentsPerformance)
Residuals:
Min 1Q Median 3Q Max
-61.671 -9.671 0.329 9.804 38.329
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 67.1957 1.0857 61.889 < 2e-16 ***
gendermale 5.1434 1.5574 3.303 0.000992 ***
test.preparation.coursenone -5.5250 1.3521 -4.086 4.74e-05 ***
gendermale:test.preparation.coursenone 3.1258 1.9440 -0.065 0.050426 .
I made the following statements :
- the intercept is the average math score for female students who completed the test preparation course
- males have a math score that is 5.1434 points higher than females between those who completed the course
- females who didn't take a test preparation course have a math score that is 5.5250 points lower than females who took the course
- the effect of a test preparation course is different for male and females. Male students who did not take the test preparation course have a math score 3.1258 points higher than female students who took the test preparation course
is that a correct interpretation?