# NOT RUN {
#' ## Plackett and Burman (P&B) type design for eleven 2-level factors in 12 runs
## NB. The algorithmic method is unlikely to succeed for larger P&B type designs.
GF = list(F1 = factor(1:2,labels=c("a","b")), F2 = factor(1:2,labels=c("a","b")),
F3 = factor(1:2,labels=c("a","b")), F4 = factor(1:2,labels=c("a","b")),
F5 = factor(1:2,labels=c("a","b")), F6 = factor(1:2,labels=c("a","b")),
F7 = factor(1:2,labels=c("a","b")), F8 = factor(1:2,labels=c("a","b")),
F9 = factor(1:2,labels=c("a","b")), F10= factor(1:2,labels=c("a","b")),
F11= factor(1:2,labels=c("a","b")) )
model = ~ F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + F10 + F11
Z=fraction(GF,size=12,treatments_model=model,searches=100)
print(Z$TF)
print(Z$Efficiency)
round(crossprod(scale(data.matrix(Z$TF))),6)
## Factorial treatment designs defined by sequentially fitted factorial treatment models
## 4 varieties by 3 levels of N by 3 levels of K assuming degree-2 treatment model in 24 plots.
## The single stage model gives an unequal split for the replication of the four varieties
## whereas the two stage model forces an equal split of 6 plots per variety.
## The single stage model is slightly more efficient overall (about 1.052045 versus 1.043662)
## but unequal variety replication is undesirable if all varieties are equally important.
## model terms
treatments = list(Variety = factor(1:4), N = 1:3, K = 1:3)
variety_model = ~ Variety
full_model = ~ (Variety + N + K)^2 + I(N^2) + I(K^2)
## single stage model
opt_full_treatments = fraction(treatments,24,full_model,searches=10)
opt_full_treatments$Efficiency
table(opt_full_treatments$TF[,1]) # variety replication
## two stage model
opt_var_treatments = fraction(treatments,24,variety_model,searches=10)
opt_full_treatments = fraction(opt_var_treatments$fullTF,24,full_model,variety_model,searches=10)
opt_full_treatments$Efficiency
table(opt_full_treatments$TF[,1]) # variety replication
# }
Run the code above in your browser using DataLab