Browsing resource, all submissions are temporary.
Take a look at the 'ChickWeight' dataset that comes with R. The data can be loaded with the command data(ChickWeight). A description of the dataset can be found by running ?ChickWeight.
?ChickWeight
A data frame ChickWeight is loaded to your workspace after running data(ChickWeight).
ChickWeight
a. Fit a linear model predicting the chick's weight (variable 'weight') from its time of birth (variable 'Time'). What are the numerical values of the intercept and slope? Give your answers to at least 4 significant figures outputed by R's lm() function.
lm()
Intercept =
Slope =
b. What is the meaning of the numerical value of the intercept? (Hint: You need to read the data description in ?ChickWeight to be able to fully answer this question.) regression estimate of a chick's weight in pounds when it died regression estimate of a chick's weight in pounds when it was born regression estimate of a chick's weight in gm when it was born regression estimate of a chick's weight in gm when it died
c. What is the meaning of the numerical value of the slope? chick's weight (in gm) one day after birth increase in chick's weight (in gm) per day chick's weight (in gm) one hour after birth increase in chick's weight (in pounds) per week increase in chick's weight (in pounds) per hour chick's weight (in pounds) one week after birth
d. Now fit a linear model predicting the chick's weight from its time of birth and the type of diet used to feed them (variable 'Diet'), including interaction terms. Note that 'Diet' is a factor variable with 4 levels. Fill in the following table. Give your answers to at least 4 significant figures.
e. What is the meaning of the intercept in (d)? regression estimate of the weight of chicks when they were born regardless of Diet type assignment regression estimate of the weight of chicks fed by Diet1 when they died regression estimate of the weight of chicks when they died regardless of Diet type regression estimate of the weight of chicks assigned to Diet 1 when they were born
f. What is the meaning of the slope for 'Diet3'? regression estimate of the weight of the chicks assigned to Diet3 when they died predicted growth rate of weight for chicks fed by Diet3 regression estimate of the difference between the weight of chicks assigned to Diet3 and the average weight of all chicks in the experiment when they were born regression estimate of the difference between the weight of chicks assigned to Diet3 and the average weight of all chicks in the experiment when they died the different between the predicted growth rate of weight for chicks fed by Diet3 and those fed by Diet1 regression estimate of the difference between the weight of chicks assigned to Diet3 and Diet1 when they died regression estimate of the difference between the weight of chicks assigned to Diet3 and Diet1 when they were born regression estimate of the weight of the chicks assigned to Diet3 when they were born
g. Use the coefficients in part (d) to determine the growth rate of weight (in gm/day) for chicks fed by 'Diet1', 'Diet2', 'Diet3' and 'Diet4'? Give your answers to at least 4 significant figures.
Growth rate of weight for chicks fed by 'Diet1' = gm/day
Growth rate of weight for chicks fed by 'Diet2' = gm/day
Growth rate of weight for chicks fed by 'Diet3' = gm/day
Growth rate of weight for chicks fed by 'Diet4' = gm/day
h. In the object ChickWeight, the column Chick gives a unique identifier for the chicks in the experiment. Find the prediction error (i.e. residual) of the linear model in part (d) in the weight of Chick "34" 10 days after its birth. Give your answer in gm and to at least 4 significant figures, but don't include units in your answer. (Hint: You will need to remember how to subset a vector using a logical sequence.)
Chick
Residual of the weight of Chick "34" 10 days after birth = gm
i. Suppose a chick is fed by Diet 4. Use the model in part (d) to predict the chick's weight 9 days after birth. Give your answer to at least 4 significant figures.
Predicted chick's weight = gm
j. Make plots for (1) chick weight versus time for each diet, and (2) resiudals versus time for each diet. This type of plots is more conveniently made using lattice graphics's xyplot function. From the plots, what can you say about the residuals? The residual variance is approximately uniform in time. The residual variance is approximately uniform in time only for the chicks fed by Diets 1 and 3. The residual variance decreases with time. This means that the t-values and p-values estimated by the lm() function cannot be trusted. The residual variance increases with time. This means that the t-values and p-values estimated by the lm() function cannot be trusted.