Problem #2 x=c(1.8, 2, 2.1, 1.7, 1.2, 2.3, 2.5, 2.9, 1.6, 2.2) #Daily DO (mg/l) day = 1:10 #histogram hist(xx) #QQ plot qqnorm(x) qqline(x) > ks.test(x, "pnorm", mean=mean(x), sd=sd(x)) One-sample Kolmogorov-Smirnov test data: x D = 0.089, p-value = 1 alternative hypothesis: two.sided -- All of these indicate that the data is Normally distributed --- (a)t.test(x) # provides a 95% confidence interval Equation 8-18 One Sample t-test data: x t = 13.2235, df = 9, p-value = 3.354e-07 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: 1.682726 2.377274 sample estimates: mean of x 2.03 ------ (b) N = (t_alpha/2 * s/delta)^2 delta = desired half interval To reduce the interval by 10%, delta = 0.9*(2.377274-1.682726)/2 delta [1] 0.3125466 s = sd(x) = 0.4854 N = (qt(0.025, 9)*sd(x)/delta)^2 12 additional observations are needed --------- (c)95% confidence interval on the true variance (Equation 8-21) N=length(x) alpha=0.05 alpha2=alpha/2 (N-1)*var(x) / qchisq(alpha2, N-1) (N-1)*var(x) / qchisq(1-alpha2, N-1) {0.11114980, 0.7854422} ------- (d) The 95% CI of mean DO from (a) is (1.682726 2.377274) If the 95% CI for another set of 10 days is (2.5, 3.2) Clearly the two CIs do not overlap - which means that the mean DO is significantly (at 95% confidence) differently between the two 10 day periods.