Consider the potting experiment in Problem 6.21. Analyze the data considering each replicate as a block.
dafr <- read.csv('https://raw.githubusercontent.com/vernonkat/Coursework/main/New%20Microsoft%20Excel%20Worksheet.csv',stringsAsFactors = FALSE)
head(dafr)
## Length Type Break Slope name value
## 1 10 Mallet Straight Level One 10.0
## 2 10 Mallet Straight Level Two 18.0
## 3 10 Mallet Straight Level Three 14.0
## 4 10 Mallet Straight Level Four 12.5
## 5 10 Mallet Straight Level Five 19.0
## 6 10 Mallet Straight Level Six 16.0
dafr["Length"][dafr["Length"] == 10] <- -1
dafr["Length"][dafr["Length"] == 30] <- 1
dafr["Type"][dafr["Type"] == "Cavity"] <- -1
dafr["Type"][dafr["Type"] == "Mallet"] <- 1
dafr["Break"][dafr["Break"] == "Breaking"] <- -1
dafr["Break"][dafr["Break"] == "Straight"] <- 1
dafr["Slope"][dafr["Slope"] == "Downhill"] <- -1
dafr["Slope"][dafr["Slope"] == "Level"] <- 1
dafr$replicates <- as.factor(rep(seq(1,7),16))
dafr$Type <- as.numeric(dafr$Type)
dafr$Break <- as.numeric(dafr$Break)
dafr$Slope <- as.numeric(dafr$Slope)
dafr$Length <- as.numeric(dafr$Length)
library(DoE.base)
halfnormal(aov(value~Length*Type*Break*Slope*replicates,dafr))
summary(aov(value~Length+Type+Break+Slope+replicates+Break*Slope*replicates+Type*replicates,dafr))
## Df Sum Sq Mean Sq F value Pr(>F)
## Length 1 917 917.1 13.005 0.000553 ***
## Type 1 388 388.1 5.504 0.021582 *
## Break 1 145 145.1 2.058 0.155493
## Slope 1 1 1.4 0.020 0.888518
## replicates 6 376 62.7 0.889 0.507501
## Break:Slope 1 2 1.6 0.023 0.879666
## Break:replicates 6 691 115.2 1.633 0.149512
## Slope:replicates 6 1220 203.3 2.883 0.013825 *
## Type:replicates 6 503 83.9 1.190 0.321020
## Break:Slope:replicates 6 951 158.4 2.247 0.047548 *
## Residuals 76 5360 70.5
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(aov(value~Length+Type+Break+Slope+replicates+Break*Slope*replicates+Type*replicates,dafr))
The introduction of replicates does impact our analysis a little bit, in that our data is not normally distributed and we have a new factors registering as significant.
Design an experiment for confounding a 26 factorial in four blocks. Suggest an appropriate confounding scheme, different from the one shown in Table 7.8.
We could confound on ABCE and ABDF and CDEF, creating:
block1 <- c('a','b','cd','abcd','ace','bce','de','abde','cf','abcf','adf','bdf','ef','abef','acdef','bcdef')
block2 <- c('c','abc','ad','bd','e','abe','acde','bcde','af','bf','cdf','abcdf','acef','bcef','def','abdef')
block3 <- c('ac','bc','d','abd','ae','be','cde','abcde','f','abf','acdf','bcdf','cef','abcef','adef','bdef')
block4 <- c('-1','ab','acd','bcd','ce','abce','ade','bde','acf','bcf','df','abdf','aef','bef','cdef','abcdef')
Consider the \(2^6\) design in eight blocks of eight runs each with ABCD, ACE, and ABEF as the independent effects chosen to be confounded with blocks. Generate the design. Find the other effects confounded with blocks.
An eight block design confounded on ABCD,ACE, ABEF:
block1 <- c('b','acd','ce','abde','abcf','df','aef','bcdef')
block2 <- c('abc','d','ae','bcde','bf','acdf','cef','abdef')
block3 <- c('a','bcd','abce','de','cf','abdf','bef','acdef')
block4 <- c('c','abd','be','acde','af','bcdf','abcef','def')
block5<- c('ac','bd','abe','cde','f','abcdf','bcef','adef')
block6<- c('-1','abcd','bce','ade','acf','bdf','abef','cdef')
block7<- c('bc','ad','e','abcde','abf','cdf','acef','bdef')
block8<- c('ab','cd','ace','bde','bcf','adf','ef','abcdef')
All Code Used: