library(DoE.base)
## Warning: package 'DoE.base' was built under R version 4.5.2
## Loading required package: grid
## Loading required package: conf.design
## Warning: package 'conf.design' was built under R version 4.5.2
## Registered S3 method overwritten by 'DoE.base':
## method from
## factorize.factor conf.design
##
## Attaching package: 'DoE.base'
## The following objects are masked from 'package:stats':
##
## aov, lm
## The following object is masked from 'package:graphics':
##
## plot.design
## The following object is masked from 'package:base':
##
## lengths
A<-c(-1,1,-1,1,-1,1,-1,1)
B<-c(-1,-1,1,1,-1,-1,1,1)
AB<-c(1,-1,-1,1,1,-1,-1,1)
C<-c(-1,-1,-1,-1,1,1,1,1)
AC<-c(1,-1,1,-1,-1,1,-1,1)
BC<-c(1,1,-1,-1,-1,-1,1,1)
ABC<-c(-1,1,1,-1,1,-1,-1,1)
hrs<-c(22,32,35,55,44,40,60,39)
dat<-data.frame(A,B,AB,C,AC,BC,ABC,hrs)
dat
## A B AB C AC BC ABC hrs
## 1 -1 -1 1 -1 1 1 -1 22
## 2 1 -1 -1 -1 -1 1 1 32
## 3 -1 1 -1 -1 1 -1 1 35
## 4 1 1 1 -1 -1 -1 -1 55
## 5 -1 -1 1 1 -1 -1 1 44
## 6 1 -1 -1 1 1 -1 -1 40
## 7 -1 1 -1 1 -1 1 -1 60
## 8 1 1 1 1 1 1 1 39
Running this data in a 2-block design, we determined to confound interaction ABC, because it has the highest order interaction.
We would assign positive corner points to A,B,C, ABC, and negative corner points to interactions AB,AC,BC.
For a 4-block design, we determine that AB,AC,BC interactions are confounded
Group by AB, AC pairs; each distinct pair defines a block:
Block 1: AB=-1,AC=-1 -> A,BC
Block 2: AB=-1,AC=1 -> B,AC
Block 3: AB=1,AC=-1 -> C,AB
Block 4: AB=1,AC=1 -> ABC
model = lm(hrs~A*B*C, data=dat)
coef(model)
## (Intercept) A B C A:B A:C
## 40.875 0.625 6.375 4.875 -0.875 -6.875
## B:C A:B:C
## -2.625 -3.375
halfnormal(model)
## no significant effects
From the plots shown above, we determined that there are no significant effects or blocks.
library(DoE.base)
A<-c(-1,1,-1,1,-1,1,-1,1)
B<-c(-1,-1,1,1,-1,-1,1,1)
AB<-c(1,-1,-1,1,1,-1,-1,1)
C<-c(-1,-1,-1,-1,1,1,1,1)
AC<-c(1,-1,1,-1,-1,1,-1,1)
BC<-c(1,1,-1,-1,-1,-1,1,1)
ABC<-c(-1,1,1,-1,1,-1,-1,1)
hrs<-c(22,32,35,55,44,40,60,39)
dat<-data.frame(A,B,AB,C,AC,BC,ABC,hrs)
dat
model = lm(hrs~A*B*C, data=dat)
coef(model)
halfnormal(model)