In this section we test whether the slopes for two independent populations are equal, i.e. we test the following null hypothesis:
H0: β1 = β2 i.e. β1 – β2 = 0
The test statistic is
If the null hypothesis is true then
If the two error variances are equal, then as for the test for the differences in the means, we can pool the estimates of the error variances, weighing each by their degrees of freedom, and so
Since we can replace the numerators of each by the pooled value , we have
Note that the while the null hypothesis that β = 0 is equivalent to ρ = 0, the null hypothesis that β1 = β2 is not equivalent to ρ1 = ρ2.
Example 1: We have two samples, each comparing life expectancy vs. smoking. The first sample is for males and the second for females. We want to determine whether there is any significant difference in the slopes for these two populations. We assume that the two samples have the values in Figure 1 (for men the data is the same as that in Example 1 of Regression Analysis):
Figure 1 – Data for Example 1
As can be seen from the scatter diagrams in Figure 1, it appears that the slope for women is less steep than for that of men. In fact, as can be seen from Figure 2, the slope of the regression line for men is -0.6282 and the slope for women is -0.4679, but is this difference significant?
As can be seen from the calculations in Figure 2, using both pooled and unpooled values for sRes, the null hypothesis, H0: the slopes are equal, cannot be rejected. And so we cannot conclude that there is any significant difference between the life expectancy of males and females for any incremental amount of smoking.
Figure 2 – t-test to compare slopes of regression lines