Docsity

Homework 11 Unsolved - Statistical Programming - Fall 2003 | STA 402, Assignments of Statistics

Toggle sidebar
bg1
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
pf2

Partial preview of the text

Download Homework 11 Unsolved - Statistical Programming - Fall 2003 | STA 402 and more Assignments Statistics in PDF only on Docsity!

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. Vacuum 5.26 Vacuum 5.44 Vacuum 5. Mixed 7.41 Mixed 7.33 Mixed 7. Co2 3.51 Co2 2.91 Co2 3. 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. 91.0 64. 100.0 43. 68.0 67. 87.0 56. 73.0 73. 78.0 68.

i. Create a text file containing this information. ii. Use “scan” or “read.table” or the Import menu option to bring these data into S-Plus/R. iii. Produce summary statistics for each variable (hint: see quantile or summary ) iv. Fit a linear regression model to these data. iv. Generate a plot of muscle mass as a function of age (with the regression line superimposed).

  1. USE S-Plus/R to perform a randomization test of the log(bacterial growth) data under the 4 meat packaging conditions. In this problem, we have n 1 = n 2 = n 3 = n 4 =3. Use a statistic that measures the difference in the 4 group means, e.g. CSS = SUM [ Xbar.i – XBAR ]^ where Xbar.i is the arithmetic mean of the ith group and XBAR is the mean of all of the observations. NOTE: this is a redo of a HW 7 and HW 10 problem (hint: see sample ).
  2. Write an S-Plus/R function to conduct a small Monte Carlo simulation to show that how confidence interval for the mean of an exponential distribution based upon Xbar +/- t(1- alpha/2, n-1) S/sqrt(n) performs when estimating the mean of an exponential distribution. Select at least 3 values of “n” for this illustration (say n=15, 30, and 50). Note that this is a redo of a problem from HW 6 and 10.