
Homework 11 S-Plus/R Homework
Assigned: 1 December 2003
Due: 10 December 2003
1. Refer to the 4 group (packaging method)- log-bacterial growth study. In this exercise,
use S-Plus/R to construct figures displaying the means and standard deviations. (HW 5
revisited.)
a. Construct a figure containing side-by-side boxplots (hint see boxplot or plot).
b. Construct a figure with the data points plotted. Superimpose the mean plus/minus 2
std. deviation segments on this plot (hint: see error.bar).
c. Generate summaries of responses (logcount) within each packaging condition.
2. Refer to the 4 group (packaging method)- log-bacterial growth study. In this exercise,
you will compare the one-way anova model to regression with coding. (HW 4 revisited.)
Plastic 7.66 Plastic 6.98 Plastic 7.80
Vacuum 5.26 Vacuum 5.44 Vacuum 5.80
Mixed 7.41 Mixed 7.33 Mixed 7.04
Co2 3.51 Co2 2.91 Co2 3.66
Fit the anova model and obtain the estimated effects (estimates of , 1, 2, 3, 4)
Assuming that logcount is defined as the treatment and package is defined as a factor, try
options(contrasts=c("contr.treatment", "contr.poly"))
aov(logcount~package)
options(contrasts=c("contr.sum", "contr.poly"))
aov(logcount~package)
options(contrasts=c("contr.helmert", "contr.poly"))
aov(logcount~package)
and see what happens in terms of the estimated effects. Report the results of this test.
3. The following data on age and muscle mass was collected. (HW 1 revisited.)
82.0 71.0
91.0 64.0
100.0 43.0
68.0 67.0
87.0 56.0
73.0 73.0
78.0 68.0