Q1)

First we must define :

Measuring Block-effect :

\[ \text{Block-eff} = \bar{y}_{\text{1Block1}} - \bar{y}_{\text{2Block2}} \]

So, TRUE!

Reference :
-
EXAMPLE 7.2 (pg. 310-311)

Q2)

\[ 2^k \text{design} \text{ with } 2^p \text{ blocks for } k > p \\ k = 7\\ p = 3 \]

\[ \sum_{r=1}^{7} \binom{7}{r} = 127 \text{ Total effects} \]

Main-Eff : \(\{A, B, C, D, E, F, G\}\)

Interaction-Eff :

\[ N= \text{runs }=2^7=128 \\ n=N/8=\text{Replicates = 16} \]

FALSE , The number of effects confounded with blocks is \(2^3-1 = 7\).

Q3)

A) a \(\implies\) acde \(*\) a = cde

Odd, so different Block

B) acd \(\implies\) acde \(*\) acd = e

Odd, so different Block

C) bcd \(\implies\) acde \(*\) bcd = acb

Odd, so different Block

D) be \(\implies\) acde \(*\) be = acd

Odd, so different Block

E) abe \(\implies\) acde \(*\) abe = cd

Even, so same Block

E is the answer

Q4)

False, that is exactly what makes it confounded–its the fact it cannot be separated. You cannot separate the variation due to the interaction from the variation due to blocks.

Q5)

##    run_number  A  B  C  D Run_Label  y
## 1           1 -1 -1 -1 -1       (1) 23
## 2           2  1 -1 -1 -1         a 15
## 3           3 -1  1 -1 -1         b 16
## 4           4  1  1 -1 -1        ab 18
## 5           5 -1 -1  1 -1         c 25
## 6           6  1 -1  1 -1        ac 16
## 7           7 -1  1  1 -1        bc 17
## 8           8  1  1  1 -1       abc 26
## 9           9 -1 -1 -1  1         d 28
## 10         10  1 -1 -1  1        ad 16
## 11         11 -1  1 -1  1        bd 18
## 12         12  1  1 -1  1       abd 21
## 13         13 -1 -1  1  1        cd 36
## 14         14  1 -1  1  1       acd 24
## 15         15 -1  1  1  1       bcd 33
## 16         16  1  1  1  1      abcd 34

Okay, this is a \(2^4\) factorial-design. We are going to base how we do this on lecture 7 [Slide 22-31].

In this problem we are asked to confound the highest interaction term (ABCD); that is, make it so we cannot separate the effect of ABCD and our blocks.

Further, how do we determine which Run_Label goes to which block?

## Confounded Block :
##    run_number A B C D  y Run_Label Block_membership
## 16         16 1 1 1 1 34      abcd                1
## Block 1:
##   run_number  A  B  C  D  y Run_Label Block_membership
## 1          2  1 -1 -1 -1 15         a               -1
## 2          3 -1  1 -1 -1 16         b               -1
## 3          5 -1 -1  1 -1 25         c               -1
## 4          8  1  1  1 -1 26       abc               -1
## 5          9 -1 -1 -1  1 28         d               -1
## 6         12  1  1 -1  1 21       abd               -1
## 7         14  1 -1  1  1 24       acd               -1
## 8         15 -1  1  1  1 33       bcd               -1
## Block 2:
##   run_number  A  B  C  D  y Run_Label Block_membership
## 1          1 -1 -1 -1 -1 23       (1)                1
## 2          4  1  1 -1 -1 18        ab                1
## 3          6  1 -1  1 -1 16        ac                1
## 4          7 -1  1  1 -1 17        bc                1
## 5         10  1 -1 -1  1 16        ad                1
## 6         11 -1  1 -1  1 18        bd                1
## 7         13 -1 -1  1  1 36        cd                1
## 8         16  1  1  1  1 34      abcd                1

Generally, we compute the effect via :

\[ \text{Est. Eff = }\frac{2}{n * 2^k} * \text{Contrast}_{\text{Eff}} \\ \text{n = # Replicates; k = # factors; Contrast = Block} \]

# Est Block Eff + ABCD Eff
cat("Est Block Eff + ABCD Eff : ")
## Est Block Eff + ABCD Eff :
mean(Block1$y) - mean(Block2$y)
## [1] 1.25
# Number of contrasts to compute : 
n_contrast <- choose(n = 4, 1:4)
names(n_contrast) <- c("1 factor", "2 factors", "3 factors", "4 factors")
n_contrast
##  1 factor 2 factors 3 factors 4 factors 
##         4         6         4         1
# Generate Classifications : 
dat <- dat %>% 
  # 2 factor Interaction : 6
  mutate(AB = A * B) %>% 
  mutate(AC = A * C) %>% 
  mutate(AD = A * D) %>% 
  mutate(BC = B * C) %>% 
  mutate(BD = B * D) %>% 
  mutate(CD = C * D) %>% 
  # 3 factor Interaction : 4
  mutate(ABC = A * B * C) %>% 
  mutate(ABD = A * B * D) %>% 
  mutate(ACD = A * C * D) %>% 
  mutate(BCD = B * C * D) %>%
 # 4 factor Interaction : 1
  mutate(ABCD = A * B * C * D) %>% 
  # Select Col in relevant order : 
  select(run_number:D, AB:ABCD, y, Run_Label, Block_membership)


# Calculate Contrast : 
# Function to compute contrast : 
compute_contrast <- function(var) {
  contrast <- sum(dat$y[dat[[var]] == 1]) - sum(dat$y[dat[[var]] == -1])
  return(contrast)
}

# Apply to main effects
contrasts <- c(colnames(dat[2:16]))

summary_table <- data.frame(
  Contrast_calc = sapply(contrasts, compute_contrast)
)


summary_table <- summary_table %>% mutate(Est_eff = 2*Contrast_calc/2^4)
summary_table
##      Contrast_calc Est_eff
## A              -26   -3.25
## B                0    0.00
## C               56    7.00
## D               54    6.75
## AB              56    7.00
## AC               4    0.50
## AD             -14   -1.75
## BC              18    2.25
## BD               4    0.50
## CD              32    4.00
## ABC              6    0.75
## ABD              0    0.00
## ACD             -8   -1.00
## BCD              6    0.75
## ABCD           -10   -1.25

Except note that ABCD is actually the block effect + ABCD since it is confounded

library(FrF2)
## Loading required package: DoE.base
## Loading required package: grid
## Loading required package: conf.design
## 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
# Vector of effect estimates (excluding intercept)
effects <- summary_table$Est_eff

# Label each effect
names(effects) <- contrasts

# Half-normal plot
halfnormal(effects, alpha = 0.05, main = "Half-Normal Plot of Effects")

As we can see from the half-normal plot the most significant features are :

\[ \{AB, C, D, CD, A\} \]

Previously (ex. 6.36) we got :


if you notice, the results of the test hasn’t changed. Indicating that blocking the variables hasnt made a significant difference in the overall performance of our model. Therefore it appears that blocking appears to add more complexity than is required than is required to describe what is going on, on average.

Reference :