SampleFinal2021.sol(1)
SampleFinal2021.sol(1)
Sample Final
STAT 404: Design of Experiment
Preamble: These problems are taken and slightly revised from the historical
final exams. Partial solutions (e.g., answering in incomplete sentences) are
only provided for some questions and may be insufficient for full marks on a
real exam. Ask in office hours if something is unclear.
1
Power for our F test may increase or decrease depending on the treat-
ment effects.
(c) Suppose only as an after fact, we realize that an attribute (covariate)
of the experiment unit has potential influence to the response value.
What is the name of the data analysis strategy we recommend in this
course?
ANCOVA.
tau = 1:4
nn = c(2, 1, 1, 1)
tau.bar = sum(tau*nn) / sum(nn)
sigma2 = 10
2
delta = sum(nn*(tau-tau.bar)^2) / sigma2
nn = 10:20
k = 4
N = (2+1+1+1)*nn
qq = qf(0.95, k-1, N-k)
pw = pf(qq, k-1, N-k, delta*nn, lower.tail=F)
print(round(pw, 4))
Double check whether the matrices are what you think they are.
(a) Estimate the treatment effects of both factors and their interactions.
Let βi for i ∈ {A, B, C, D} denote the effect of culvitars, let αj for
j ∈ {I, II, III} denote the effects of beches, and let ωij denote the
3
interaction effect between culvitar i and bench j. The estimates for
the main effects are given by
R code:
mean.trt = colMeans(rbind(yy1,yy2))
mean.bench = rowMeans(cbind(yy1, yy2))
mean.int = (yy1 + yy2)/2
ybar = mean(mean.trt)
beta <- mean.trt - ybar
alpha <- mean.bench - ybar
omega <- t(t(mean.int - mean.bench) - mean.trt)+ ybar
I = 4
J = 3
n = 2
SS.trt = n*J*sum((mean.trt-ybar)^2)
4
SS.bench = n*I*sum((mean.bench-ybar)^2)
SS.int = n*sum((mean.int-
matrix(rep(mean.bench,I),J,I,byrow=F)-
matrix(rep(mean.trt,J),J,I,byrow=T)+
ybar)^2)
SS.total = sum((yy1-ybar)^2) + sum((yy2-ybar)^2)
SS.err = SS.total - SS.bench - SS.trt - SS.int
MS.trt = SS.trt / (I-1)
MS.bench = SS.bench / (J-1)
MS.int = SS.int / ((I-1)*(J-1))
MS.err = SS.err / (I*J*(n-1))
R code:
5
The variance of β̂A = ȳA.. − ȳ... is
6
7. Following the last question.
Suppose 8 and 9 are two blocking factors and denote them as B1 and
B2 instead. The defining relations in (2) become
(2∗ ) 7 = 125; B1 = 246, B2 = 356;
(a) how many blocks does this design have?
4.
(b) How many runs are there in each block?
16.
Using the rule that lower order interactions are more likely significant.
run 1 2 3 4 5 yield
1 − − + − −
2 + + + − −
3 − + − − +
4 + − − − +
5 − + − + −
6 + − − + −
7 − − + + +
8 + + + + +
7
(a) Which interactions are aliased with two factor interaction 14?
14 = 234 = 135 = 25
(b) Create a two-factor interaction plot for factors 1 and 4.
Ignore other factors that aliased with it). Whichever way will be ac-
cepted. You may find draw it by hand is less time consuming. However,
be sure to have axises and scales clearly marked.
R code:
(c) Obtain the estimates of all factors (or aliased set of factors).
8
The estimate for the main effect of factor i is given by
µ̂1 = 3.0065, µ̂2 = 0.1485, µ̂3 = 1.0425, µ̂4 = −0.4105, µ̂5 = −1.1705.
1 = 23 = 1345 = 245
2 = 13 = 2345 = 145
3 = 12 = 45 = 12345
4 = 1234 = 35 = 125
5 = 1235 = 34 = 124
14 = 234 = 135 = 25
15 = 235 = 134 = 24.
The estimates for these two interaction effects are µ̂14 = 8.3095 and
µ̂15 = 0.6785.
R code:
N = 8
n = N / 2
mu1 = sum(yy*coln1) / n
mu2 = sum(yy*coln2) / n
mu3 = sum(yy*coln3) / n
mu4 = sum(yy*coln4) / n
mu5 = sum(yy*coln5) / n
mu14 = sum(yy*coln1*coln4) / n
mu15 = sum(yy*coln1*coln5) / n
9
The variance of each effect estimator is
σ2
Var(ȳi=+ − ȳi=− ) = 2Var(ȳi=+ ) = .
2
q
2 √
Hence, the standard deviation is σ2 = 1.2/ 2 = 0.8485.
(e) which of the main effects are significant at 5% level assuming σ 2 =
1.22 ?
An effect is significant if its absolute value is greater than 97.5% critical
value of the standard normal distribution, which is 1.96. Thus, both
µ̂1 and µ̂14 are significant at the 5% level.
R code:
(f) What are the observed value and fitted value at run 4?
The observed value at run 4 is -0.087. Only keep the significant factors,
we have the fitted value being
10