> library(car)
> Burt$class <- with(Burt, factor(class, levels=c("low", "medium", "high")))
> scatterplot(IQbio ~ IQfoster | class, data=Burt,
+ boxplots=FALSE, smooth=FALSE)
The regression lines for the three classes are not very different, but they are also remarkably parallel.
> burt.mod <- lm(IQbio ~ IQfoster*class, data=Burt)
> summary(burt.mod)
Call:
lm(formula = IQbio ~ IQfoster * class, data = Burt)
Residuals:
Min 1Q Median 3Q Max
-14.479 -5.248 -0.155 4.582 13.798
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.20461 16.75126 0.430 0.672
IQfoster 0.94842 0.18218 5.206 3.69e-05 ***
classmedium -6.38859 31.02087 -0.206 0.839
classhigh -9.07665 24.44870 -0.371 0.714
IQfoster:classmedium 0.02414 0.33933 0.071 0.944
IQfoster:classhigh 0.02914 0.24458 0.119 0.906
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 7.921 on 21 degrees of freedom
Multiple R-squared: 0.8041, Adjusted R-squared: 0.7574
F-statistic: 17.24 on 5 and 21 DF, p-value: 8.31e-07
> Anova(burt.mod)
Anova Table (Type II tests)
Response: IQbio
Sum Sq Df F value Pr(>F)
IQfoster 4674.7 1 74.5132 2.382e-08 ***
class 175.1 2 1.3958 0.2697
IQfoster:class 0.9 2 0.0074 0.9926
Residuals 1317.5 21
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
There is no evidence of an interaction, and only weak evidence of a class main effect. There is very strong evidence for an IQfoster “effect.”
The p-value for the interaction is very close to 1, indicating that the three regression lines are almost perfectly parallel. Data this parallel would occur by chance less than 1 percent of the time, even if there were no interaction in the population.