#data
A <- c(-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1)
B <- c(-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1,1,1,1,1)
C <- c(-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1)
D <- c(-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1)
Yield <- c(12,18,13,16,17,15,20,15,10,25,13,24,19,21,17,23)
#17a
#factorial model
model <- aov(Yield ~ factor(A) * factor(B) * factor(C) * factor(D))
summary(model)
## Df Sum Sq Mean Sq
## factor(A) 1 42.25 42.25
## factor(B) 1 16.00 16.00
## factor(C) 1 1.00 1.00
## factor(D) 1 81.00 81.00
## factor(A):factor(B) 1 0.00 0.00
## factor(A):factor(C) 1 0.00 0.00
## factor(B):factor(C) 1 0.25 0.25
## factor(A):factor(D) 1 64.00 64.00
## factor(B):factor(D) 1 72.25 72.25
## factor(C):factor(D) 1 2.25 2.25
## factor(A):factor(B):factor(C) 1 2.25 2.25
## factor(A):factor(B):factor(D) 1 0.25 0.25
## factor(A):factor(C):factor(D) 1 2.25 2.25
## factor(B):factor(C):factor(D) 1 4.00 4.00
## factor(A):factor(B):factor(C):factor(D) 1 4.00 4.00
Answer:
From the full factorial at α = 0.05, three effects are statistically significant. Factor A, factor D, and the interaction of factors a and D have a significant effect. All other main effects (B and C) and all other interactions have p-values greater than 0.05 and are not significant. Therefore, the significant factors are A, D, and the A×D interaction, which should be retained in the model while all non-significant terms can be pooled into error
#17b
model_reduced <- aov(Yield ~ factor(A) + factor(D) + factor(A):factor(D))
summary(model_reduced)
## Df Sum Sq Mean Sq F value Pr(>F)
## factor(A) 1 42.25 42.25 4.852 0.0479 *
## factor(D) 1 81.00 81.00 9.301 0.0101 *
## factor(A):factor(D) 1 64.00 64.00 7.349 0.0189 *
## Residuals 12 104.50 8.71
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Answer: After pooling non-significant terms into the error term, the reduced model retains only the significant effects: A, D, and A×D. The reduced model confirms that all three effects remain significant at α = 0.05. This indicates that both time and temperature independently affect yield, and importantly, the effect of time depends on the temperature level, as evidenced by the significant interaction. Factors B and C can be eliminated from consideration as they do not significantly affect yield in this process
{r eval=FALSE}