Model Equation for four factor interaction:
\(Y_{ijkl} = \mu + \alpha_i + \beta_j + \gamma_k+ \delta_l+ \alpha\beta_ij + \alpha\gamma_ik+ \beta\gamma_jk + \alpha\delta_il+ \beta\delta_jl+ \gamma\delta_kl+ \alpha\beta\gamma_ijk + \alpha\beta\delta_ijl + \alpha\gamma\delta_ikl + \beta\gamma\delta_jkl + \alpha\beta\gamma\delta_ijkl + \epsilon_ijkl\)
Where
\(\alpha_i\) is Main Effects of Factor A (pin elevation)
\(\beta_j\) is Main Effects of Factor B (Bungee Position)
\(\gamma_k\) is Main Effects of Factor C (Release Angle)
\(\delta_l\) is Main Effects of Factor D (Ball Type)
\(\alpha\beta_ij\) is Interaction effects of Factors A and Factors B
\(\alpha\gamma_ik\) is Interaction effects of Factors A and Factors C
\(\beta\gamma_jk\) is Interaction effects of Factors B and Factors C
\(\alpha\delta_il\) is Interaction effects of Factors A and Factors D
\(\beta\delta_jl\) is Interaction effects of Factors B and Factors D
\(\gamma\delta_kl\) is Interaction effects of Factors C and Factors D
\(\alpha\beta\gamma_ijk\) is Interaction effects of Factors A, Factors B and Factors C
\(\alpha\beta\delta_ijl\) is Interaction effects of Factors A, Factors B and Factors D
\(\alpha\gamma\delta_ikl\) is Interaction effects of Factors A, Factors C and Factors D
\(\beta\gamma\delta_jkl\) is Interaction effects of Factors B, Factors C and Factors D
\(\alpha\beta\gamma\delta_ijkl\) is Interaction effects of Factors A, Factors B, Factors C and Factors D
\(\epsilon_ijkl\) is error
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
library(agricolae)
treat<-c(2,2,2,2)
d<-design.ab(treat,1,design = "crd",seed= 1111644)
design<-d$book
design
## plots r A B C D
## 1 101 1 1 2 1 1
## 2 102 1 2 2 2 1
## 3 103 1 1 2 2 1
## 4 104 1 1 2 2 2
## 5 105 1 1 2 1 2
## 6 106 1 2 1 1 1
## 7 107 1 2 1 2 2
## 8 108 1 2 2 1 1
## 9 109 1 1 1 1 2
## 10 110 1 1 1 1 1
## 11 111 1 2 2 1 2
## 12 112 1 2 1 1 2
## 13 113 1 1 1 2 1
## 14 114 1 2 2 2 2
## 15 115 1 1 1 2 2
## 16 116 1 2 1 2 1
library(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
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)
obs<-c(34,68,48,40,30,42,57,43,33,27,42,37,37,57,38,66)
dat<-data.frame(A,B,C,D,obs)
dat
## A B C D obs
## 1 -1 1 -1 -1 34
## 2 1 1 1 -1 68
## 3 -1 1 1 -1 48
## 4 -1 1 1 1 40
## 5 -1 1 -1 1 30
## 6 1 -1 -1 -1 42
## 7 1 -1 1 1 57
## 8 1 1 -1 -1 43
## 9 -1 -1 -1 1 33
## 10 -1 -1 -1 -1 27
## 11 1 1 -1 1 42
## 12 1 -1 -1 1 37
## 13 -1 -1 1 -1 37
## 14 1 1 1 1 57
## 15 -1 -1 1 1 38
## 16 1 -1 1 -1 66
model<-lm(obs~A*B*C*D,data = dat)
coef(model)
## (Intercept) A B C D A:B
## 43.6875 7.8125 1.5625 7.6875 -1.9375 -0.5625
## A:C B:C A:D B:D C:D A:B:C
## 2.8125 0.3125 -1.3125 -1.0625 -1.4375 -0.8125
## A:B:D A:C:D B:C:D A:B:C:D
## 1.3125 -0.3125 -0.3125 -0.4375
halfnormal(model)
##
## Significant effects (alpha=0.05, Lenth method):
## [1] A C
model1<-aov(obs~A+C+A*C,data = dat)
summary(model1)
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 976.6 976.6 51.230 1.15e-05 ***
## C 1 945.6 945.6 49.603 1.35e-05 ***
## A:C 1 126.6 126.6 6.639 0.0242 *
## Residuals 12 228.7 19.1
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the results of halfnormal plot we can conclude that factors A and C seems to be significant.
Model Equation of significant factor
\(Y_{ik} = \mu + \alpha_i + \gamma_k+ \alpha\gamma_ik + \epsilon_ik\)
Where
\(\alpha_i\) is Main Effects of Factor A (pin elevation)
\(\gamma_k\) is Main Effects of Factor C (Release Angle)
\(\alpha\gamma_ik\) is Interaction effects of Factors A and Factors C
\(\epsilon_ijkl\) is error
Testing higher level interaction hypothesis first
Hypothesis to be tested first
Null Hypothesis(H0)= Interaction effect of Factor A and C is significant
Alternate Hypothesis(Ha)= Interaction effect of Factor A, and C is not significant
From the results of the ANOVA table, the p-value of interaction of factor A and Factor C is 0.0242. As p-value is lesser than the alpha 0.05, we conclude that we reject the null hypothesis. Hence we conclude that interaction is significant
As we rejected the null hypothesis for interaction we must stop exploration on the associated factors
According to the ANOVA table, the p-value for factor A is 1.15e-05 and for factor C is 1.35e-05.
ALL CODE
library(GAD)
library(agricolae)
treat<-c(2,2,2,2)
d<-design.ab(treat,1,design = "crd",seed= 1111644)
design<-d$book
design
library(DoE.base)
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)
obs<-c(34,68,48,40,30,42,57,43,33,27,42,37,37,57,38,66)
dat<-data.frame(A,B,C,D,obs)
dat
model<-lm(obs~A*B*C*D,data = dat)
coef(model)
halfnormal(model)
model1<-aov(obs~A+C+A*C,data = dat)
summary(model1)