Propose a data collection layout with a randomized run order
We used the design function in R for creating a \(2^4\) factorial design. Each factor (A,B,C,D) has two settings:
A: Pin Elevation (Position 1 or Position 3)
B: Bungee Position (Position 2 or Position 3)
C: Release Angle (\(140^\circ\) or \(170^\circ\))
D: Ball Type (Yellow Foam or Red Tennis)
Each combination of these four factors with their two levels will be tested once in the order given below:
library(agricolae)
design <- design.ab(trt=c(2,2,2,2),r=1,design="crd")
design$book
## plots r A B C D
## 1 101 1 2 2 1 2
## 2 102 1 2 2 2 2
## 3 103 1 2 1 1 1
## 4 104 1 2 2 2 1
## 5 105 1 1 1 1 2
## 6 106 1 1 1 2 2
## 7 107 1 2 1 2 2
## 8 108 1 1 2 2 2
## 9 109 1 2 2 1 1
## 10 110 1 2 1 1 2
## 11 111 1 1 2 1 1
## 12 112 1 2 1 2 1
## 13 113 1 1 1 2 1
## 14 114 1 1 2 1 2
## 15 115 1 1 2 2 1
## 16 116 1 1 1 1 1
The picture above shows the locations of the pin elevation, angle of throw, and bungee position we are testing.
Collect data and record observations.
Our data was collected in the order given and is shown below:
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)
RESULTS <- c(58,43,37,19,36,63,33,18,37,44,35,37,50,33,38,41)
dafr <- data.frame(RESULTS,A,B,C,D)
head(dafr)
## RESULTS A B C D
## 1 58 1 -1 1 -1
## 2 43 -1 1 1 1
## 3 37 1 1 -1 1
## 4 19 -1 -1 -1 -1
## 5 36 -1 -1 1 -1
## 6 63 1 1 1 -1
The negative ones in our matrix stand for the low level option (ex:Position 2 of Bungee Postion) and the positive ones for the higher option (ex:Ball Type Red Tennis)
State model equation and determine what factors/interactions appear to be significant (show any plots that were used in making this determination)
Our full model equation is:
\(Y_{i,j,k,l}\) = \(\mu\) + \(\alpha_i\) + \(\beta_j\) + \(\gamma_k\) + \(\delta_l\) + \(\alpha\beta_{i,j}\) + \(\alpha\gamma_{i,k}\) + \(\alpha\delta_{i,l}\) + \(\beta\gamma_{j,k}\) + \(\beta\delta_{j,l}\) + \(\gamma\delta_{k,l}\) + \(\alpha\beta\gamma_{i,j,k}\) + \(\alpha\gamma\delta_{i,k,l}\) + \(\beta\gamma\delta_{j,k,l}\) + \(\alpha\beta\gamma\delta_{i,j,k,l}\) + \(\epsilon_{i,j,k,l}\)
The following halfnormal plot shows which of the above factors from our full equation significantly deviate from the normal distribution.
library(DoE.base)
halfnormal(aov(RESULTS~A*B*C*D))
Using the halfnormal plot, we can see that only the main effects A(Pin Elevation) and C(Release Angle) are significant.
After using insignificant factors/interactions to create an error term, perform ANOVA to determine a final model equation using an alpha = 0.05
summary(aov(RESULTS~A+C))
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 552.3 552.3 13.28 0.002968 **
## C 1 961.0 961.0 23.11 0.000342 ***
## Residuals 13 540.5 41.6
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Our factors A(Pin Elevation) and C(Release Angle) are indeed significant with p values below our significance level of .05. We will find their coefficients to make a final model equation to predict the ball’s distance.
coef(aov(RESULTS~A+C))
## (Intercept) A C
## 38.875 5.875 7.750
Our final model equation for predicting the distance the ball will go is:
\(y=38.875+5.875A+7.750C\)
library(agricolae)
design <- design.ab(trt=c(2,2,2,2),r=1,design="crd")
design$book
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)
RESULTS <- c(58,43,37,19,36,63,33,18,37,44,35,37,50,33,38,41)
dafr <- data.frame(RESULTS,A,B,C,D)
head(dafr)
library(DoE.base)
halfnormal(aov(RESULTS~A*B*C*D))
summary(aov(RESULTS~A+C))
coef(aov(RESULTS~A+C))