Data Collection Layout

For \(2^4\) factorial design, we used design.ab to generate one replication of a run order for our \(2^4\) factorial design

##    plots r A B C D
## 1    101 1 1 1 2 1
## 2    102 1 1 1 2 2
## 3    103 1 1 2 1 2
## 4    104 1 2 2 2 1
## 5    105 1 2 1 2 1
## 6    106 1 2 2 2 2
## 7    107 1 1 2 2 2
## 8    108 1 1 2 2 1
## 9    109 1 1 2 1 1
## 10   110 1 2 2 1 2
## 11   111 1 2 1 1 2
## 12   112 1 2 1 2 2
## 13   113 1 2 2 1 1
## 14   114 1 1 1 1 2
## 15   115 1 1 1 1 1
## 16   116 1 2 1 1 1

Experiment Data and Data Frame

For each of our 4 factors, we had two levels for each factors. They were classified as -1(low) and a +1(high). The different factor levels,and the assigned variables.

Factors and Low and High Levels
Factor Low Level(-1) High Level(+1)
A Pin Location Postion 1 Postion 3
B Bungee Position Position 2 Position 3
C Release Angle 140 degrees 170 degrees
D Ball Type Yellow Red

Here is our data that we collected from the experiment.

##    Pin_Elevation Bungee_Position Release_Angle Ball_Type response
## 1             -1              -1             1        -1       36
## 2             -1              -1             1         1       35
## 3             -1               1            -1         1       34
## 4              1               1             1        -1       60
## 5              1              -1             1        -1       68
## 6              1               1             1         1       60
## 7             -1               1             1         1       37
## 8             -1               1             1        -1       38
## 9             -1               1            -1        -1       33
## 10             1               1            -1         1       41
## 11             1              -1            -1         1       42
## 12             1              -1             1         1       52
## 13             1               1            -1        -1       51
## 14            -1              -1            -1         1       34
## 15            -1              -1            -1        -1       26
## 16             1              -1            -1        -1       47

Null and Alternative Hypothesis Testing

Here are the Hypothesis tests that we used in the experiment. We started at the highest order hypothesis test, which was \(\alpha_i\)*\(\beta_j\) hypothesis test.

Ho: \(\alpha_{i} = 0\) - Null Hypothesis

Ha: \(\alpha_{i} \ne 0\) - Alternative Hypothesis

Ho: \(\beta_{j} = 0\) - Null Hypothesis

Ha: \(\beta_{j} \ne 0\) - Alternative Hypothesis

Ho: \(\alpha \beta_{ij} = 0\) - Null Hypothesis

Ha: \(\alpha \beta_{ij} \ne 0\) - Alternative Hypothesis

Model Equation and Half Normal Plot

Half Normal Plot

## 
## Significant effects (alpha=0.05, Lenth method):
## [1] Pin_Elevation Release_Angle

From the plot, factors Pin Elevation and Release Angle are significant model terms.

Model Equation

\(y_{i} = \beta_{0} + \beta_{1}x_{i1} + \beta_{2}x_{i2} +\epsilon_{i}\)

\(Distance = {43.37} - 9.25x_{i1} + 4.875x_{i2}\)

ANOVA Model

After running the half normal plot , we run the ANOVA model with those factors and generated the following table.

##               Df Sum Sq Mean Sq F value   Pr(>F)    
## Pin_Elevation  1 1369.0  1369.0   51.96 6.86e-06 ***
## Release_Angle  1  380.2   380.2   14.43  0.00221 ** 
## Residuals     13  342.5    26.3                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##    (Intercept) Pin_Elevation1 Release_Angle1 
##          29.25          18.50           9.75

From the result, values of “Prob > F” less than 0.0500 indicate model terms are significant. In this case Pin_Elevation and Release_Angle are significant model terms.

\(y_{i} = \beta_{0} + \beta_{1}x_{i1} + \beta_{2}x_{i2} +\epsilon_{i}\)

\(Distance = {29.25} - 18.50x_{i1} + 9.75x_{i2}\)

Code for the Experiment

library(agricolae)
#?design.ab
trts<-c(2,2,2,2)
design<-design.ab(trt=trts, r=1, design="crd",seed=878900)

design$book

library(knitr)
A <- c("Pin Location","Postion 1","Postion 3")
B <-c("Bungee Position" ,"Position 2",  "Position 3")
C<-c("Release Angle",   "140 degrees",  "170 degrees")
D<-c("Ball Type",   "Yellow",   "Red")
F_levels <- rbind(A,B,C,D)
colnames(F_levels)<- c("Factor","Low Level(-1)","High Level(+1)")
kable(F_levels,caption = "Factors and Low and High Levels")

library(DoE.base)
Pin_Elevation<-c(-1,-1,-1,1,1,1,-1,-1,-1,1,1,1,1,-1,-1,1)
Bungee_Position<-c(-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,-1)
Release_Angle<-c(1,1,-1,1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,-1)
Ball_Type<-c(-1,1,1,-1,-1,1,1,-1,-1,1,1,1,-1,1,-1,-1)
response<-c(36,35,34,60,68,60,37,38,33,41,42,52,51,34,26,47)
dat<-data.frame(Pin_Elevation,Bungee_Position,Release_Angle,Ball_Type,response)
dat

model<-lm(response~Pin_Elevation*Bungee_Position*Release_Angle*Ball_Type, data = dat)
#summary(model)
coef(model)

halfnormal(model)
Pin_Elevation<-as.factor(Pin_Elevation)
Bungee_Position<-as.factor(Bungee_Position)
Release_Angle<-as.factor(Release_Angle)
Ball_Type<-as.factor(Ball_Type)

model1<-aov(response~Pin_Elevation+Release_Angle)
summary(model1)
coef(model1)