This part of the project is meant to use design of experiment tools and techniques to make optimum decisions based on statistical values. In section 1, we determinate how many samples we should collect to detect a mean difference with a medium effect and a probability of 0.75. In section 2, we collected data based on the randomized order that was generated using computer language called Rstudio to run completely randomized design (CRD function) with an alpha of 0.05 . We then proposed our layout such that our data is tabulated, neat, ranked, and well organized. In Section 3, we performed hypothesis test and checked our residuals versus fitted values and other residuals plots to make sure that nothing unusual present. Finally, we will state our findings and provide related comments and recommendations
We performed experiment to determine the effect of the type of ball on the distance in which the ball is thrown. The Release Angle should be at 90 degrees, with the arm pulled fully back before releasing it. In order to determine the distance traveled by 3 different types of ball “Blue, red, and Yellow” we made sure that the zeros are initiated, and the rubber elasticity remain the same during our experiment.
The following project will be completed by our group using Stratapult.
There are four discrete settings for both the Pin Elevation and Bungee Position, numbered from the bottom up. The Release Angle is a continuous variable from 90 to 180 degrees.There are additionally three types of balls that may be used. We will perform a designed experiment to determine the effect of the type of ball on the distance in which the ball is thrown.
The Pin Elevation and Bungee Position should both be at their fourth setting, i.e. highest setting. The Release Angle should be at 90 degrees, with the arm pulled fully back before releasing. To test this hypothesis, we wish to use a completely randomized design with an alpha around 0.05
Part 1
Determining the samples to be collected to detect a mean difference with a medium effect (i.e. 50% of the standard deviation) with a probability of 75%.
The Hypothesis for this experimemt is stated as follow:
Null Hypothesis: H0= Uy=Ur=Ub
Alternative hypothesis: Ha= at least one Ui differs
Note: Uy= mean distance recorded using yellow ball
Ur= mean distance recorded using Red ball
Ub= mean distance recorded using blue ball
library(pwr)
library(dplyr)
library(tidyr)
library(agricolae)
pwr.anova.test(k=3,n=NULL,f=0.5,sig.level=0.05,power=0.75)
Balanced one-way analysis of variance power calculation
k = 3
n = 12.50714
f = 0.5
sig.level = 0.05
power = 0.75
n is number in each group
Number of samples to be collected in each group is n = 12.5071
Therefore: we need to collect 13 samples for each ball type
Part 2
Proposing a layout using the number of samples from part (a) with randomized run order
library(agricolae)
## Warning: package 'agricolae' was built under R version 4.0.5
trt0<-c("Yellow","Red","Blue")
design<-design.crd(trt=trt0,r=13,seed=500)
design$book
## plots r trt0
## 1 101 1 Yellow
## 2 102 1 Blue
## 3 103 2 Blue
## 4 104 2 Yellow
## 5 105 3 Blue
## 6 106 4 Blue
## 7 107 1 Red
## 8 108 2 Red
## 9 109 5 Blue
## 10 110 6 Blue
## 11 111 3 Yellow
## 12 112 3 Red
## 13 113 4 Red
## 14 114 5 Red
## 15 115 7 Blue
## 16 116 6 Red
## 17 117 4 Yellow
## 18 118 8 Blue
## 19 119 9 Blue
## 20 120 5 Yellow
## 21 121 6 Yellow
## 22 122 7 Yellow
## 23 123 10 Blue
## 24 124 11 Blue
## 25 125 7 Red
## 26 126 8 Yellow
## 27 127 12 Blue
## 28 128 13 Blue
## 29 129 8 Red
## 30 130 9 Yellow
## 31 131 10 Yellow
## 32 132 9 Red
## 33 133 10 Red
## 34 134 11 Red
## 35 135 12 Red
## 36 136 11 Yellow
## 37 137 13 Red
## 38 138 12 Yellow
## 39 139 13 Yellow
Part 3
Data collected and recorded observations on layout Proposed
design<-as.data.frame(design)
Distance<-c(69,71,86,79,67,61,65,64,73,68,71,69,71,67,
69,65,79,70,68,67,67,73,68,64,69,73,65,62,
63,60,64,67,65,62,71,65,63,63,69)
design$Distance<-Distance
experiment<-design[,-1:-8]
colnames(experiment)<-c("Order","BALL","Distance")
r<-rank(experiment$Distance,ties.method = "average")
experiment$Rank<-r
experiment$BALL<-as.factor(experiment$BALL)
head(experiment)
## Order BALL Distance Rank
## 1 1 Yellow 69 26.0
## 2 1 Blue 71 31.5
## 3 2 Blue 86 39.0
## 4 2 Yellow 79 37.5
## 5 3 Blue 67 18.0
## 6 4 Blue 61 2.0
Part 4
Performing hypothesis test and checking residuals
hypothesis:
Null Hypothesis: H0= Uy=Ur=Ub
Alternative hypothesis: Ha= at least one Ui differs
aov.model<-aov(Distance~BALL, data = experiment)
summary.aov(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## BALL 2 62.9 31.46 1.154 0.327
## Residuals 36 981.1 27.25
plot(aov.model)
P-value is larger that alpha of 0.05. We fail to reject H0. From the plot we can see that the spread of the residuals tends to be not equal to fitted values. However, it is very close to each other.
The residual and normality plots show that the variance is approximately constant for all three treatments and the model is adequate in terms of normality (see below). This means that no corrective measures are needed, such as transformations or the like, and the initial p-value can be used for conclusions
TukeyHSD(aov.model)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Distance ~ BALL, data = experiment)
##
## $BALL
## diff lwr upr p adj
## Red-Blue -2.3846154 -7.389541 2.620310 0.4816229
## Yellow-Blue 0.5384615 -4.466464 5.543387 0.9626351
## Yellow-Red 2.9230769 -2.081848 7.928002 0.3377326
plot(TukeyHSD(aov.model))
Tukey test for multiple comparisons of differences in means levels of Balls at 95% familty-wise confidence level. Zero is included in the interval therefore we fail to reject H0.
Part 5
We fail to reject H0, there is therefore no need for pairwise comparisons*
Conclusion
The null hypothesis that the mean of all treatments are the same cannot be rejected at an alpha of 0.05 since the calculated p-value, since 0.327 < 0.05. This means that there may not be a significant difference between the treatment/different balls distance means, indicating that the difference in balls chosen to achieve the different distance may not be of importance here.
This can be confirmed with further testing, such as using Tukey’s test to see which pairs of means differ. Such gives the following 95% confidence intervals between pairs of Balls shown above.
Since all of these confidence intervals include 0, the null hypothesis that each of the means of the distance achieved by the different type of ball is the same has once again fail to be rejected. This verifies that there is not a difference between the means for the different angles.
CODE
library(dplyr)
library(tidyr)
library(agricolae)
## Hypothesis:
## Null Hypothesis: H0= Uy=Ur=Ub
## Alternative hypothesis: Ha= at least one Ui differs
pwr.anova.test(k=3,n=NULL,f=0.5,sig.level=0.05,power=0.75)
## Balanced one-way analysis of variance power calculation
## Balanced one-way analysis of variance power calculation
## k = 3
## n = 12.50714
## f = 0.5
## sig.level = 0.05
## power = 0.75
## NOTE: n is number in each group
## Number of samples to be collected in each group is n = 12.50714
trt0<-c("Yellow","Red","Blue")
design<-design.crd(trt=trt0,r=13,seed=500)
# Layout
design$book
design<-as.data.frame(design)
# data
Distance<-c(69,71,86,79,67,61,65,64,73,68,71,69,71,67,
69,65,79,70,68,67,67,73,68,64,69,73,65,62,
63,60,64,67,65,62,71,65,63,63,69)
design$Distance<-Distance
experiment<-design[,-1:-8]
colnames(experiment)<-c("Order","BALL","Distance")
r<-rank(experiment$Distance,ties.method = "average")
experiment$Rank<-r
experiment$BALL<-as.factor(experiment$BALL)
str(experiment)
print(experiment)
#AOV MODEL
aov.model<-aov(Distance~BALL, data = experiment)
summary.aov(aov.model)
plot(aov.model)
## Anova results
## Df Sum Sq Mean Sq F value Pr(>F)
## BALL 2 62.9 31.46 1.154 0.327
## Residuals 36 981.1 27.25
## P-value is larger that alpha of 0.05. We fail to reject H0.
## From the plot we can see that the spread of the residuals tends to be not equal to fitted values.
## However, it is very close to each other.
## TukeyHSD test
TukeyHSD(aov.model)
plot(TukeyHSD(aov.model))
## Comments:TukeyHSD test for multiple comparisons of differences in means levels of Balls at 95% familty-wise confidence level.
## Zero is included in the interval therefore we fail to reject H0.
This report is being submitted by our group in fulfillment of the final project in IE 5324 in the Fall 2021 semester. It is original work and we have not received assistance in its preparation by any person outside of this group.