Performing a designed experiment to determine the effect of the available factors of Pin Elevation, Fire Angle, Bungee Position, Release Angle and ball type, on distance in which a ball was thrown.
We observed that
This is an un-replicated \(2^{4}\) design with four factors and each factor has a low level (-1) and a high level(+1). The four factors are:
Factor A is Pin Elevation and it has two levels where the low level is (-1) and it is at position 1 and the high level (+1) and it is at position 3.
Factor B is Bungee Position and it has two levels where position 2 is at low level (-1) and position 3 is at high level (+1).
Factor C is Release Angle and it has two levels where 90 degrees is at low level (-1) and 110 degrees is at high level (+1).
Factor D is Ball Type and it has two levels where the yellow ball is at low level (-1) and the red ball is at high level (+1).
Proposing a data collection layout with a randomized order we have
library(agricolae)
trts <- c(2,2,2,2)
design <- design.ab(trt=trts,r=1,design = "crd",seed = 11345)
design$book
## plots r A B C D
## 1 101 1 1 1 1 1
## 2 102 1 2 2 2 2
## 3 103 1 2 1 1 2
## 4 104 1 2 2 2 1
## 5 105 1 2 2 1 1
## 6 106 1 1 2 2 1
## 7 107 1 1 1 1 2
## 8 108 1 1 1 2 2
## 9 109 1 1 1 2 1
## 10 110 1 2 1 2 1
## 11 111 1 1 2 2 2
## 12 112 1 1 2 1 1
## 13 113 1 1 2 1 2
## 14 114 1 2 2 1 2
## 15 115 1 2 1 1 1
## 16 116 1 2 1 2 2
dat<-read.csv("part.csv",TRUE,",")
dat
## X plots r A B C D values
## 1 1 101 1 -1 -1 -1 -1 35
## 2 2 102 1 1 1 1 1 62
## 3 3 103 1 1 -1 -1 1 31
## 4 4 104 1 1 1 1 -1 60
## 5 5 105 1 1 1 -1 -1 34
## 6 6 106 1 -1 1 1 -1 46
## 7 7 107 1 -1 -1 -1 1 29
## 8 8 108 1 -1 -1 1 1 42
## 9 9 109 1 -1 -1 1 -1 44
## 10 10 110 1 1 -1 1 -1 64
## 11 11 111 1 -1 1 1 1 29
## 12 12 112 1 -1 1 -1 -1 35
## 13 13 113 1 -1 1 -1 1 34
## 14 14 114 1 1 1 -1 1 37
## 15 15 115 1 1 -1 -1 -1 48
## 16 16 116 1 1 -1 1 1 57
Model Equation
\(Y_{ikjl}=\mu+\alpha_{i}+\beta_{j}+\alpha\beta_{ij}+\gamma_{k}+\alpha\gamma_{ik}+\beta\gamma_{jk}+\alpha\beta\gamma_{ijk}+\delta_{l}+\alpha\delta_{il}+\beta\delta_{jl}+\gamma\delta_{kl}+\alpha\beta\delta_{ijl}+\alpha\gamma\delta_{ikl}+\beta\gamma\delta_{jkl}+\alpha\beta\gamma\delta_{ijkl}+\epsilon_{ijkl}\)
where
\(\alpha_{i}\)= Factor A (Pin elevation)
\(\beta_{j}\)= Factor B ( Bungee Position)
\(\gamma_{k}\)=Factor C ( Release Angle)
\(\delta\)= Factor D ( Ball type)
\(\epsilon_{ijkl}\) = Random error term
library(DoE.base)
model<-lm(values~A*B*C*D,data=dat)
halfnormal(model)
From the half normal plots, we can see that the significant factors are A,C,A:C. This essentially means that only Pin elevation, Release angle and the interaction between Pin elevation and release angle are significant.
Performing analysis of variance to determine the final model we have
Main effect ( Pin elevation)
Null hypothesis : \(\alpha_{i}=0\) For all i
Alternative hypothesis: \(\alpha\neq 0\) for some i
Main effect (Release angle)
Null hypothesis- \(\gamma_{k}=0\) for all k
Alternative hypothesis- \(\gamma_{k}=0\) for some k
Interaction effect (Pin elevation & Release angle)
Null hypothesis- \(\alpha\gamma_{ik}=0\)
Alternative hypothesis- \(\alpha\gamma_{ik}\neq 0\)
dat2<-dat[,c("A","C","values")]
dat2
## A C values
## 1 -1 -1 35
## 2 1 1 62
## 3 1 -1 31
## 4 1 1 60
## 5 1 -1 34
## 6 -1 1 46
## 7 -1 -1 29
## 8 -1 1 42
## 9 -1 1 44
## 10 1 1 64
## 11 -1 1 29
## 12 -1 -1 35
## 13 -1 -1 34
## 14 1 -1 37
## 15 1 -1 48
## 16 1 1 57
library(GAD)
dat2$A<-as.fixed(dat2$A)
dat2$C<-as.fixed(dat2$C)
model1<-aov(values~A*C,data = dat2)
GAD::gad(model1)
## Analysis of Variance Table
##
## Response: values
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 612.56 612.56 18.6923 0.0009901 ***
## C 1 915.06 915.06 27.9231 0.0001933 ***
## A:C 1 264.06 264.06 8.0579 0.0149345 *
## Residual 12 393.25 32.77
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Based on the ANOVA values
We can see that the p-value of factor A, factor C and factor A:C (0.0011619, 0.0002014,0.0166751) are all significant because they are all less than our reference significant level of alpha(0.05)
Therefore we are rejecting the null hypothesis claiming that they have significant effect on the model.
The final model can be written has
\(Y_{ikl}=\mu+\alpha_{i}+\gamma_{k}+\alpha\gamma_{ik}+\epsilon_{ikl}\)
\(\alpha_{i}\)= Factor A (Pin elevation)
\(\gamma_{k}\)= Factor C ( Release Angle)
\(\alpha\gamma_{ik}\) = interaction term between factor A and factor C
\(\epsilon_{ikl}\)= Standard error term