Assign3 Sol PDF
Assign3 Sol PDF
by
1
0.016vs0.03 -7.9500 8.9268 -0.8906 -31.5393 15.6393
0.016vs0.044 -30.5687 8.9268 -3.4244 -54.1580 -6.9795
0.016vs0.058 -34.1812 8.9268 -3.8291 -57.7705 -10.5920
0.03vs0.044 -22.6187 8.9268 -2.5338 -46.2080 0.9705
0.03vs0.058 -26.2312 8.9268 -2.9385 -49.8205 -2.6420
0.044vs0.058 -3.6125 8.9268 -0.4047 -27.2018 19.9768
These intervals are slightly tighter than the CIs using Bonferroni’s
method.
Unlike the problem in Midterm, the sample sizes are the same for all
treatments in this problem.
(b) When the random effect model is used, the treatment effects are
regarded as random variables. The analysis of variance table remains
the same as the one-way layout.
Source Df Sum Sq Mean SS F-value p-value
Area 3 13514.98 4504.99 7.07 0.004
Error 60 38250.26 637.50
Total 63 51765.24
To test for H0 : στ2 = 0, we use the same F-statistic which equals 7.07,
and same reference distribution, F-distribution with 3 and 60 degrees
of freedom. The p-value is 0.004 as given in the above table. Hence,
the variance of the random treatment effect is significantly larger than
0.
(c) The recommended estimate of the treatment variance is
2 2
(d) The variance of the the overall mean is given by var(η̂) = σkτ + σN .
where k = 4 is the number of treatments and N = 64 is the overall
sample size. We also computed σ̂τ2 = 241.72 and σ̂ 2 = 637.5. So
2
Finally, the c=95% CI for η is given by
δ = 56.61765n.
3
Compute the potential sample size with n = 1, 2, . . . , 10, we find the
powers at these choices of n will be
powers = (0.9997, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
tau = c(1, 2, 4, 6)
nn = c(6, 3, 2, 6)
tau.bar = sum(tau*nn)/sum(nn)
sigma2 = 1.44
delta = sum(nn*(tau - tau.bar)^2)/sigma2
[1] 56.61765
(b) We need only make some minor changes in code to find the min-
imum sample size. It is seen that the power exceeds 70% when n1 =
n2 = n3 = n4 = 3. The total required sample size is 12.
So assigning larger sample sizes to treatments 1 and 4 is not a good
strategy and is unnecessary. The previous arrangement does not help.
If σ 2 = 30 as suggested in the announcement, the total is 88. In this
case, the previous arrangement does help.
The codes are as follows:
4
tau = c(1, 2, 4, 6)
nn = c(1, 1, 1, 1)
tau.bar = sum(tau*nn)/sum(nn)
sigma2 = 1.44
delta = sum(nn*(tau - tau.bar)^2)/sigma2
3. The following are the weights (in grams) of size rock samples (from
different lakes) measured on two different scales. The purpose of this
data collection is to test whether the two scales are different (in terms
of weighing).
(a) What is the most likely design used in this problem?
(b) Perform an appropriate t-test at the 0.05 level to test the null
hypothesis that scales I and II give the same measurement. Formulate
this hypothesis and give details of your computations.
(c) Perform an appropriate randomization test at the 0.08 level to test
the null hypothesis that scales I and II give the same measurement.
(d) Construct a 95% (two-sided) confidence interval of the mean differ-
ence. Remark, we did not give a formula for this in class.
The data set is file rock.dat in a canvas folder.
5
Solution.
(a) The design is paired-experiment.
(b) Making use of the blocking information, it is sensible to assume
that
yi1 ∼ N (µi , σ12 ); yi2 ∼ N (µi + δ, σ22 )
for i = 1, . . . , n, and some parameters µi and δ1 , σ12 ; δ2 , σ22 . The
observations are iid.
These lead to the differences di = yi2 − yi1 ∼ N (δ, σ12 + σ22 )).
The hypothesis to be tested is H0 : δ = 0 against two-sided alternative.
The value of the paired-t statistic is −3.08. The p.value is 0.027. So
the null hypothesis is rejected at nominal level 0.05.
Then applying the paired t-test, we calculate the paired-t test statistic
using the following R code:
dd = scale_I - scale_II
dd.var = var(dd)
tt.paired = mean(dd)/(dd.var/length(dd))^.5
p.value = 2*pt(abs(tt.paired), length(dd)-1, lowertail=F)
p.value
[1] 0.02742923
6
only possible ways are: (1) to flip the sign of d4 while keeping other di ’s
the same, (2) flip the signs of other di ’s except d4 , (3) same as observed
difference, (4) flip the sign of all di ’s. This gives us two cases that are
more extreme and two cases that are equally extreme. This gives us
p-value for the randomization test p = (2 + 2 ∗ 0.5)/64 = 0.0468. Based
on this analysis, the null hypothesis is still rejected, not helped by the
larger permitted nominal value.
The p-value is not as extreme as the paired t-test. One reason is that
the number of pairs being 6 is somewhat low. In order for two tests to
give closer p-values, larger n value is needed
(d) The universal two-sided CI at 95% is
q
δ̂ ± qt(0.975, df ) ∗ σ̂ 2 /n
dd.mean = mean(dd)
dd.mean-qt(.975, 5)*(dd.var/6)^.5
[1] -3.974216
dd.mean+qt(.975, 5)*(dd.var/6)^.5
[1] -0.3591172