x1=matrix(c( 1,0,-1,-1, 1,-1,0,0, 1,0,1,0, 1,1,0,1, 1,-1,-1,-1, 1,-1,1,0), byrow=T,nrow=6) x2=x1 x2[5,]=c(1,-1,0,-1) x2[6,]=c(1,1,0,0) x3=matrix(c( 1,1,0,1, 1,-1,0,-1, 1,1,0,1, 1,-1,0,0, 1,1,0,0, 1,-1,0,0), byrow=T,nrow=6) x4=x3 x4[,4]=c(1,-1,0,0,0,0) x5=x4 x5[2,4]=0 x6=x5 x6[,4]=c(1,-1,1,-1,1,0) x1 x2 x3 x4 x5 x6 solve(t(x1)%*%x1) solve(t(x2)%*%x2) solve(t(x3[,-3])%*%x3[,-3]) solve(t(x4[,-3])%*%x4[,-3]) solve(t(x5[,-3])%*%x5[,-3]) solve(t(x6[,-3])%*%x6[,-3]) g1=c(1,0,0,0) t(g1)%*%solve(t(x1)%*%x1)%*%g1 t(g1)%*%solve(t(x2)%*%x2)%*%g1 g2=c(0,0,1,0) t(g2)%*%solve(t(x1)%*%x1)%*%g2 t(g2)%*%solve(t(x2)%*%x2)%*%g2 g3=c(0,1,0,1) t(g3)%*%solve(t(x1)%*%x1)%*%g3 t(g3)%*%solve(t(x2)%*%x2)%*%g3 g4=c(0,0,1,.5) t(g4)%*%solve(t(x1)%*%x1)%*%g4 t(g4)%*%solve(t(x2)%*%x2)%*%g4 g5=c(0,1,0,.5) t(g5)%*%solve(t(x1)%*%x1)%*%g5 t(g5)%*%solve(t(x2)%*%x2)%*%g5 #Now consider the 2x3 factorial experiment and compare two designs #with regard to the test for interaction H0:theta1=theta2=0. X1=matrix(c( 1,1,1,1,1,1, 0,0,-1,0,0,1, 1,-1,0,1,-1,0, 0,1,0,-1,0,0, 1,-1,0,0,0,0, 0,1,-1,0,0,0),nrow=6) X2=matrix(c( 1,1,1,1,1,1, 1,-1,1,-1,1,-1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,1,-1,0,0, 0,0,0,0,1,-1),nrow=6) X1 X2 M=matrix(c(0,0,0,0,0,0,0,0,1,0,0,1),nrow=2) M det(M%*%solve(t(X1)%*%X1)%*%t(M)) library(MASS) det(M%*%ginv(t(X2)%*%X2)%*%t(M))