Submission is due on Tuesday in Week 6.
Consider the linear regression models:
and
These models look very similar, except that the explanatory variable has been centred (about the mean) in the second model. The centring of explanatory variables is common, especially for data from designed experiments.
Write down the design matrices and for models C1 and C2 respectively.
[marks: 1]
Calculate and . Which model gives independent estimators for the two regression coefficients? Explain your answer.
[marks: 2]
Give interpretations of the intercept terms and . Which do you feel has the most useful interpretation?
[marks: 1]
Explain why and have the same interpretation.
[marks: 1]
The full FEV data set first discussed in Question Sheet 2 is available in the file fev. The data frame in this file has 654 records and six variables, including age (years), FEV (litres), height (inches), gender (1 for male, 0 for female), smoker (0 for no, 1 for yes) and log FEV.
Consider the following linear regression model,
where is FEV, is an indicator function for males and is age.
Using the function lm fit this model to the full FEV data set. What are your least squares estimates ?
[marks: 1]
What is the predicted FEV for a 12 year old female?
[marks: 1]
For this model and data set,
and the estimated residual variance is .
Using these results, decide whether or not there is evidence for an interaction between age and sex. You should explain what is meant by an interaction, and state clearly you hypotheses and conclusions.
[marks: 3]
Challenge
The data in the data frame buttermilk contains the percentage of butterfat in the milk of cows sampled from five breeds (Ayrshire, 1; Canadian, 2; Guernsey, 3; Holstein-Fresian, 4; Jersey, 5). Within each breed, both mature (coded as 1) and young (coded as 2) cows have been sampled. Load the data into R.
How many cows are in the full sample? How many cows have been sampled from each breed? How many cows are young and how many are mature?
[marks: 1]
By fitting an appropriate multiple linear regression model, assess whether breed or age has an effect on the percentage buttermilk.
[marks: 3]
Using the model fitted above in part (b), what is the expected percentage butterfat for a mature Guernsey cow?
[marks: 1]