A similar approach can be taken for linear combinations of regression coefficients. From Section 8.2, we know that also has a normal distribution, with mean and variance . To test
vs.
we use a similar argument as above, comparing the test statistic
to the distribution.
The variance of can be calculated using the expression .
Recall the simple linear regression relating birth weight to gestational age at birth,
We want to test whether gestational age has a significant positive effect on birth weight, that is, vs. .
First, calculate . From Example 7.1.1 this is,
Now calculate the test statistic,
Compare to the distribution. From R, is 1.72. Since , we conclude that there is evidence to reject at the 5% level and say that gestational age at birth does affect birth weight.
We can use R to help us with the test. Consider again the output of the summary function
Note that we can obtain the standard error of directly from the Coefficients table. In fact, we can obtain the -value for the required test, . This is clearly significant at the 5% level. However, if we want to test where , we must still calculate the test statistic by hand. For examination purposes, you will be expected to be able to calculate the test statistic using expression (8.3), so do not become too reliant on R.
Recall from equation (6.6) the model relating gas consumption to outside temperature and whether or not cavity wall insulation has been installed. We fitted this model in Example 7.1.3.
Before cavity wall insulation was installed, was there a significant relationship between outside temperature and gas consumption?
After cavity wall insulation was installed, is there a significant relationship between outside temperature and gas consumption?
To answer question 1, we test
vs.
To do this, first calculate the estimated residual variance by calculating the fitted values, then the residuals and finally using expression (7.5).
Since we are testing , we need . In R,
Then the test statistic is
Since and , we compare to . Clearly , so we conclude that there is evidence to reject the null hypothesis at the 5% level. i.e. there is evidence of a relationship between outside temperature and gas consumption.
We have seen that the relationship between gas consumption and outside temperature after insulation is given by . So, to answer question 2, we need to test
vs.
First, calculate the variance of . From Math230,
Next, obtain the required elements from ,
and calculate the test statistic,
Finally, compare to . Since we conclude that, at the 5% level, there is evidence of a relationship between gas consumption and outside temperature, once insulation has been installed. So, the insulation has not entirely isolated the house from the effects of external temperature, but it does appear to have weakened this relationship.