Question 1 solution:
Yes, this is a valid latin square as each latin letter occurs only once in each column and rowyes, this is a valid latin square as each latin letter occurs only once in each column and row.
Question 2 solution:
y_ijk= µ + τi + \(\beta_j\) + \(\alpha_k\) +\epsilon_ijk
µ = Grand Mean
τi = Treatment effect
βj = Block-1 effect
αk = Block-2 effect
εijk = Random error
i = number of treatments
j = number of block-1
k = number of block-2
library(GAD)
batch<- c(rep(1,5), rep(2,5), rep(3,5),rep(4,5),rep(5,5))
day<-c(seq(1,5), seq(1,5), seq(1,5),seq(1,5),seq(1,5))
variable<-c("A", "B", "D", "C", "E","C", "E", "A", "D", "B","B", "A", "C", "E", "D","D", "C", "E", "B", "A","E", "D", "B", "A", "C" )
value<-c(8,7,1,7,3,11,2,7,3,8,4,9,10,1,5,6,8,6,6,10,4,2,3,8,8)
dat<-data.frame(batch,day, variable, value)
dat$batch<-as.fixed(dat$batch)
dat$day<-as.fixed(dat$day)
dat$variable<-as.fixed(dat$variable)
model<-lm(value~batch+day+variable, data=dat)
anova(model)
## Analysis of Variance Table
##
## Response: value
## Df Sum Sq Mean Sq F value Pr(>F)
## batch 4 15.44 3.860 1.2345 0.3476182
## day 4 12.24 3.060 0.9787 0.4550143
## variable 4 141.44 35.360 11.3092 0.0004877 ***
## Residuals 12 37.52 3.127
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We accept null hypothesis as p-value is less than 0.05.