Perform a designed experiment to determine the effect of Pin Elevation and Release Angle on distance in which a red ball is thrown when the Bungee Position is fixed at the second position. Settings one and three of Pin Elevation should be investigated as a fixed effect, as well as settings of the Release Angle corresponding to 110, 140, and 170 degrees as a random effect. The design should be replicated three times
As shown above, we will be throwing our red tennis ball using the Statapult, and changing our various settings from position 1 and 3 on the picture shown above, and angles of 110, 140, and 170.
State model equation with the null and alternative hypotheses to be tested. In addition, state the level of significance that will be used in your analysis.
We will be using a traditional value of .05 as our significance level.
Our model equation is as follows: \(y_{ijk}=\mu+\alpha_{i}+\beta_j+\alpha\beta_{ij}+\epsilon_{ijk}\)
Where \(\alpha\) represents the deviation from a mean given by the pin setting, and \(\beta\) represents the deviation from the mean given by the throwing angle. \(\alpha\beta_{ij}\) represents the possible error given by the two factors having a relationship between them.
Propose a layout with a randomized run order
We did so through the design.ab function found in the agricolae package in R. As shown below:
library(agricolae)
layout <- design.ab(trt=c(2,3),r=3,design="crd")
layout$book
## plots r A B
## 1 101 1 1 3
## 2 102 2 1 3
## 3 103 1 1 1
## 4 104 1 2 3
## 5 105 2 2 3
## 6 106 1 1 2
## 7 107 2 1 2
## 8 108 1 2 2
## 9 109 3 1 2
## 10 110 1 2 1
## 11 111 2 1 1
## 12 112 2 2 2
## 13 113 3 1 3
## 14 114 3 2 2
## 15 115 3 2 3
## 16 116 3 1 1
## 17 117 2 2 1
## 18 118 3 2 1
This chart shows us what order to perform our tests in, with the column ‘A’ indicating one of our two pin positions, and column ‘B’ indicating an angle the throwing arm was pulled to.
The ‘r’ column counts how many times the particular combination of pin position and throwing angle has occurred. Because we were requested to have 3 replications, each combination happens 3 times.
Collect data and record observations on the layout proposed in part (a)
We have two factors to keep track of (Pin position and Angle of throwing arm). Our experiment was performed in the given order found in part a, and the results are shown below:
angles <- rep(c(110,140,170),6)
pinsetting <- c(rep(1,9),rep(3,9))
dat <- c(22, 35, 48, 22 ,37, 48, 21 ,39, 44, 27, 47 ,59 ,25, 44, 50, 24, 42, 58)
dafr <- data.frame(angles,pinsetting)
dafr$result <- dat
head(dafr)
## angles pinsetting result
## 1 110 1 22
## 2 140 1 35
## 3 170 1 48
## 4 110 1 22
## 5 140 1 37
## 6 170 1 48
Test the hypotheses and state conclusions, determining those effects that are significant. Show any plots that might be useful/necessary to show your findings. You may also show residual plots and make appropriate comments, but do not transform the data (i.e. use the raw data regardless of normality and variance constancy)
We will be using the GAD library in R in order to set our angle as a random factor, and our pin as a fixed. We will be testing (with our .05 significance level) whether either of the two factors have an impact on the distance our ball is thrown. For each factor, our null hypothesis will be if the error represented by that factor is equal to 0 or not. Mathematically:
Null:\(\alpha_{i}=0\) vs Alternative:\(\alpha_{i}\neq0\)
Null:\(\beta_{j}=0\) vs Alternative:\(\beta_{j}\neq0\)
Null:\(\alpha\beta_{ij}=0\) vs Alternative:\(\alpha\beta_{ij}\neq0\)
We will be using a significance level of .05
library(GAD)
dafr$angles <- as.random(dafr$angles)
dafr$pinsetting <- as.fixed(dafr$pinsetting)
model <- aov(result~angles+pinsetting+pinsetting*angles,dafr)
GAD::gad(model)
## Analysis of Variance Table
##
## Response: result
## Df Sum Sq Mean Sq F value Pr(>F)
## angles 2 2340.78 1170.39 164.5859 1.893e-09 ***
## pinsetting 1 200.00 200.00 17.9104 0.05155 .
## angles:pinsetting 2 22.33 11.17 1.5703 0.24787
## Residual 12 85.33 7.11
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The interaction effect was definitely not present, at a p-value of .2. We can see that angle of the throwing arm is definitely significant with a p-value well less than .05. In this case, we would reject our null hypothesis and state that it does have an effect on the distance the ball was thrown. Pin Setting was very nearly significant in our model, only having 0.00155 difference between the significance level of .05 and its p-value.
par(mfrow=c(2,2))
plot(model)
From our residuals, we can see that our data may benefit from a transformation, as the residuals do show a difference in variance. However, we were told to not transform our data at this point in the project. We additionally can see that it does appear to be normally distributed though.
library(agricolae)
layout <- design.ab(trt=c(2,3),r=3,design="crd")
layout$book
angles <- rep(c(110,140,170),6)
pinsetting <- c(rep(1,9),rep(3,9))
dat <- c(22, 35, 48, 22 ,37, 48, 21 ,39, 44, 27, 47 ,59 ,25, 44, 50, 24, 42, 58)
dafr <- data.frame(angles,pinsetting)
dafr$result <- dat
head(dafr)
library(GAD)
dafr$angles <- as.random(dafr$angles)
dafr$pinsetting <- as.fixed(dafr$pinsetting)
model <- aov(result~angles+pinsetting+pinsetting*angles,dafr)
GAD::gad(model)
par(mfrow=c(2,2))
plot(model)