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.
SECTION A: HYPOTHESIS AND SAMPLE SIZE
Determine how many samples should be collected to detect a mean difference with a medium effect (i.e. 50% of the standard deviation) and a pattern of maximum variability with a probability of 75%.
Hypothesis:
The Hypothesis are:
Null Hypothesis: \(H_{0}\)= \(\mu_{y}\)=\(\mu_{r}\)=\(\mu_{b}\)
Alternative hypothesis: \(H_{a}\)= at least one \(\mu_{i}\) differs
Note: \(\mu_{y}\) = mean distance recorded using yellow ball
\(\mu_{r}\) = mean distance recorded using red ball
\(\mu_{b}\) = mean distance recorded using blue ball
library(pwr)
pwr.anova.test(k=3,n=NULL,f=0.5,sig.level=0.05,power=0.9999559)
##
## Balanced one-way analysis of variance power calculation
##
## k = 3
## n = 53.00039
## f = 0.5
## sig.level = 0.05
## power = 0.9999559
##
## NOTE: n is number in each group
Balanced one-way analysis of variance power calculation
Number of samples to be collected in each group is n = 53.00039
Therefore: we need to collect 53 samples for each ball type
SECTION B: RANDOMIZED RUN AND LAYOUT
Propose a layout using the number of samples from section A with randomized run order.
library(agricolae)
trt0<-c("Yellow","Red","Blue")
design<-design.crd(trt=trt0,r=53,seed=2000)
design$book
## plots r trt0
## 1 101 1 Blue
## 2 102 1 Red
## 3 103 1 Yellow
## 4 104 2 Red
## 5 105 3 Red
## 6 106 4 Red
## 7 107 2 Yellow
## 8 108 5 Red
## 9 109 3 Yellow
## 10 110 2 Blue
## 11 111 3 Blue
## 12 112 6 Red
## 13 113 4 Blue
## 14 114 4 Yellow
## 15 115 5 Yellow
## 16 116 6 Yellow
## 17 117 7 Red
## 18 118 8 Red
## 19 119 9 Red
## 20 120 5 Blue
## 21 121 7 Yellow
## 22 122 10 Red
## 23 123 8 Yellow
## 24 124 11 Red
## 25 125 6 Blue
## 26 126 12 Red
## 27 127 7 Blue
## 28 128 9 Yellow
## 29 129 10 Yellow
## 30 130 13 Red
## 31 131 14 Red
## 32 132 15 Red
## 33 133 8 Blue
## 34 134 11 Yellow
## 35 135 12 Yellow
## 36 136 13 Yellow
## 37 137 14 Yellow
## 38 138 15 Yellow
## 39 139 9 Blue
## 40 140 16 Yellow
## 41 141 17 Yellow
## 42 142 10 Blue
## 43 143 11 Blue
## 44 144 16 Red
## 45 145 17 Red
## 46 146 12 Blue
## 47 147 18 Yellow
## 48 148 18 Red
## 49 149 19 Yellow
## 50 150 20 Yellow
## 51 151 19 Red
## 52 152 13 Blue
## 53 153 21 Yellow
## 54 154 20 Red
## 55 155 22 Yellow
## 56 156 23 Yellow
## 57 157 24 Yellow
## 58 158 21 Red
## 59 159 14 Blue
## 60 160 15 Blue
## 61 161 25 Yellow
## 62 162 16 Blue
## 63 163 22 Red
## 64 164 17 Blue
## 65 165 18 Blue
## 66 166 19 Blue
## 67 167 23 Red
## 68 168 26 Yellow
## 69 169 24 Red
## 70 170 27 Yellow
## 71 171 20 Blue
## 72 172 28 Yellow
## 73 173 25 Red
## 74 174 26 Red
## 75 175 21 Blue
## 76 176 22 Blue
## 77 177 23 Blue
## 78 178 24 Blue
## 79 179 29 Yellow
## 80 180 25 Blue
## 81 181 26 Blue
## 82 182 27 Blue
## 83 183 30 Yellow
## 84 184 28 Blue
## 85 185 29 Blue
## 86 186 27 Red
## 87 187 28 Red
## 88 188 31 Yellow
## 89 189 32 Yellow
## 90 190 33 Yellow
## 91 191 29 Red
## 92 192 34 Yellow
## 93 193 35 Yellow
## 94 194 30 Red
## 95 195 31 Red
## 96 196 36 Yellow
## 97 197 30 Blue
## 98 198 37 Yellow
## 99 199 32 Red
## 100 200 38 Yellow
## 101 201 39 Yellow
## 102 202 31 Blue
## 103 203 40 Yellow
## 104 204 33 Red
## 105 205 34 Red
## 106 206 35 Red
## 107 207 32 Blue
## 108 208 36 Red
## 109 209 41 Yellow
## 110 210 33 Blue
## 111 211 34 Blue
## 112 212 35 Blue
## 113 213 37 Red
## 114 214 42 Yellow
## 115 215 36 Blue
## 116 216 38 Red
## 117 217 39 Red
## 118 218 43 Yellow
## 119 219 44 Yellow
## 120 220 40 Red
## 121 221 45 Yellow
## 122 222 41 Red
## 123 223 37 Blue
## 124 224 38 Blue
## 125 225 46 Yellow
## 126 226 39 Blue
## 127 227 42 Red
## 128 228 40 Blue
## 129 229 41 Blue
## 130 230 43 Red
## 131 231 42 Blue
## 132 232 43 Blue
## 133 233 47 Yellow
## 134 234 44 Blue
## 135 235 48 Yellow
## 136 236 44 Red
## 137 237 49 Yellow
## 138 238 45 Blue
## 139 239 50 Yellow
## 140 240 51 Yellow
## 141 241 45 Red
## 142 242 46 Red
## 143 243 46 Blue
## 144 244 47 Blue
## 145 245 47 Red
## 146 246 48 Blue
## 147 247 52 Yellow
## 148 248 48 Red
## 149 249 49 Blue
## 150 250 49 Red
## 151 251 50 Red
## 152 252 50 Blue
## 153 253 51 Red
## 154 254 51 Blue
## 155 255 52 Red
## 156 256 53 Yellow
## 157 257 52 Blue
## 158 258 53 Red
## 159 259 53 Blue
SECTION C: DATA COLLECTION
Collect data and record observations on layout proposed in section B.
design<-as.data.frame(design)
Distance<-c(171,107,131,114,113,94,170,89,125,128,127,94,102,114,102,117,108,109,95,112,115,98,120, 110,125,
114,131,135,124,107,109,111,123,105,107,133,124,105,115,116,103,165,162,118,102,156,127,107,125,
107,117,101,103,88,99,103,101,95,109,102,105,99,104,119,128,165,109,117,112,124,103,114,117,111,
163,159,143,147,131,128,171,129,129,127,129,94,103,131,117,102,87,123,102,90,97,127,102,109,98,
99,101,102,99,87,93,97,105,97,103,101,128,129,107,135,175,125,119,138,135,116,162,121,153,154,
122,151,123,145,147,113,125,119,114,124,108,107,125,124,115,101,105,99,113,127,123,99,116,114,
112,102,117,102,109,99,104,89,103,125,118)
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)
## 'data.frame': 159 obs. of 4 variables:
## $ Order : int 1 1 1 2 3 4 2 5 3 2 ...
## $ BALL : Factor w/ 3 levels "Blue","Red","Yellow": 1 2 3 2 2 2 3 2 3 1 ...
## $ Distance: num 171 107 131 114 113 94 170 89 125 128 ...
## $ Rank : num 157.5 57 134.5 80.5 76 ...
print(experiment)
## Order BALL Distance Rank
## 1 1 Blue 171 157.5
## 2 1 Red 107 57.0
## 3 1 Yellow 131 134.5
## 4 2 Red 114 80.5
## 5 3 Red 113 76.0
## 6 4 Red 94 9.0
## 7 2 Yellow 170 156.0
## 8 5 Red 89 4.5
## 9 3 Yellow 125 116.0
## 10 2 Blue 128 126.5
## 11 3 Blue 127 122.0
## 12 6 Red 94 9.0
## 13 4 Blue 102 34.5
## 14 4 Yellow 114 80.5
## 15 5 Yellow 102 34.5
## 16 6 Yellow 117 92.5
## 17 7 Red 108 61.5
## 18 8 Red 109 65.5
## 19 9 Red 95 11.5
## 20 5 Blue 112 73.0
## 21 7 Yellow 115 85.0
## 22 10 Red 98 16.5
## 23 8 Yellow 120 101.0
## 24 11 Red 110 69.0
## 25 6 Blue 125 116.0
## 26 12 Red 114 80.5
## 27 7 Blue 131 134.5
## 28 9 Yellow 135 139.0
## 29 10 Yellow 124 110.0
## 30 13 Red 107 57.0
## 31 14 Red 109 65.5
## 32 15 Red 111 70.5
## 33 8 Blue 123 105.5
## 34 11 Yellow 105 51.0
## 35 12 Yellow 107 57.0
## 36 13 Yellow 133 137.0
## 37 14 Yellow 124 110.0
## 38 15 Yellow 105 51.0
## 39 9 Blue 115 85.0
## 40 16 Yellow 116 88.0
## 41 17 Yellow 103 43.0
## 42 10 Blue 165 154.5
## 43 11 Blue 162 151.5
## 44 16 Red 118 96.5
## 45 17 Red 102 34.5
## 46 12 Blue 156 149.0
## 47 18 Yellow 127 122.0
## 48 18 Red 107 57.0
## 49 19 Yellow 125 116.0
## 50 20 Yellow 107 57.0
## 51 19 Red 117 92.5
## 52 13 Blue 101 27.0
## 53 21 Yellow 103 43.0
## 54 20 Red 88 3.0
## 55 22 Yellow 99 21.0
## 56 23 Yellow 103 43.0
## 57 24 Yellow 101 27.0
## 58 21 Red 95 11.5
## 59 14 Blue 109 65.5
## 60 15 Blue 102 34.5
## 61 25 Yellow 105 51.0
## 62 16 Blue 99 21.0
## 63 22 Red 104 47.5
## 64 17 Blue 119 99.0
## 65 18 Blue 128 126.5
## 66 19 Blue 165 154.5
## 67 23 Red 109 65.5
## 68 26 Yellow 117 92.5
## 69 24 Red 112 73.0
## 70 27 Yellow 124 110.0
## 71 20 Blue 103 43.0
## 72 28 Yellow 114 80.5
## 73 25 Red 117 92.5
## 74 26 Red 111 70.5
## 75 21 Blue 163 153.0
## 76 22 Blue 159 150.0
## 77 23 Blue 143 142.0
## 78 24 Blue 147 144.5
## 79 29 Yellow 131 134.5
## 80 25 Blue 128 126.5
## 81 26 Blue 171 157.5
## 82 27 Blue 129 130.5
## 83 30 Yellow 129 130.5
## 84 28 Blue 127 122.0
## 85 29 Blue 129 130.5
## 86 27 Red 94 9.0
## 87 28 Red 103 43.0
## 88 31 Yellow 131 134.5
## 89 32 Yellow 117 92.5
## 90 33 Yellow 102 34.5
## 91 29 Red 87 1.5
## 92 34 Yellow 123 105.5
## 93 35 Yellow 102 34.5
## 94 30 Red 90 6.0
## 95 31 Red 97 14.0
## 96 36 Yellow 127 122.0
## 97 30 Blue 102 34.5
## 98 37 Yellow 109 65.5
## 99 32 Red 98 16.5
## 100 38 Yellow 99 21.0
## 101 39 Yellow 101 27.0
## 102 31 Blue 102 34.5
## 103 40 Yellow 99 21.0
## 104 33 Red 87 1.5
## 105 34 Red 93 7.0
## 106 35 Red 97 14.0
## 107 32 Blue 105 51.0
## 108 36 Red 97 14.0
## 109 41 Yellow 103 43.0
## 110 33 Blue 101 27.0
## 111 34 Blue 128 126.5
## 112 35 Blue 129 130.5
## 113 37 Red 107 57.0
## 114 42 Yellow 135 139.0
## 115 36 Blue 175 159.0
## 116 38 Red 125 116.0
## 117 39 Red 119 99.0
## 118 43 Yellow 138 141.0
## 119 44 Yellow 135 139.0
## 120 40 Red 116 88.0
## 121 45 Yellow 162 151.5
## 122 41 Red 121 102.0
## 123 37 Blue 153 147.0
## 124 38 Blue 154 148.0
## 125 46 Yellow 122 103.0
## 126 39 Blue 151 146.0
## 127 42 Red 123 105.5
## 128 40 Blue 145 143.0
## 129 41 Blue 147 144.5
## 130 43 Red 113 76.0
## 131 42 Blue 125 116.0
## 132 43 Blue 119 99.0
## 133 47 Yellow 114 80.5
## 134 44 Blue 124 110.0
## 135 48 Yellow 108 61.5
## 136 44 Red 107 57.0
## 137 49 Yellow 125 116.0
## 138 45 Blue 124 110.0
## 139 50 Yellow 115 85.0
## 140 51 Yellow 101 27.0
## 141 45 Red 105 51.0
## 142 46 Red 99 21.0
## 143 46 Blue 113 76.0
## 144 47 Blue 127 122.0
## 145 47 Red 123 105.5
## 146 48 Blue 99 21.0
## 147 52 Yellow 116 88.0
## 148 48 Red 114 80.5
## 149 49 Blue 112 73.0
## 150 49 Red 102 34.5
## 151 50 Red 117 92.5
## 152 50 Blue 102 34.5
## 153 51 Red 109 65.5
## 154 51 Blue 99 21.0
## 155 52 Red 104 47.5
## 156 53 Yellow 89 4.5
## 157 52 Blue 103 43.0
## 158 53 Red 125 116.0
## 159 53 Blue 118 96.5
SECTION D:HYPOTHESIS TEST AND RESIDUAL PLOT
aov.model<-aov(Distance~BALL, data = experiment)
summary.aov(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## BALL 2 12959 6479 22.52 2.55e-09 ***
## Residuals 156 44875 288
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(aov.model)
P-value p= 2.55e-09 is smaller than alpha of \(\alpha\)=0.05. we conclude that null hypothesis is rejected. 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 -22.11321 -29.909507 -14.316908 0.0000000
## Yellow-Blue -11.16981 -18.966111 -3.373511 0.0025349
## Yellow-Red 10.94340 3.147096 18.739696 0.0031834
plot(TukeyHSD(aov.model))
Tukey test for multiple comparisons of differences in means levels of Balls at 95% familty-wise confidence level. Zero is not included in the intervals therefore we reject null hypothesis.
SECTION E: PAIRWISE COMPARISONS
Since null hypothesis is rejected we performed pairwise comparisons.We reject Null hypothesis , We found out that the difference of the means differs. Therefore, the Ball_Type is significant. To illustrate this, We performed the Tukey test pairwise comparison at 95% family wise confidence level which shows that the mean of the blue ball differs from the mean of the yellow and red. It seems that the mean of the red is equal to the average mean of all treatments. We do not have enough information about the balls to make a decision on what factors affected the means. We believe that Weight, shape, material, geometry, and centeroid of each ball may be the reason of this differences. in fact, The blue ball had an irregular shape than others.another factor that could affect this experiment it was the rubber itself because it was broken and we changed. This is another factor that is related to the elasticity of the rubber which could affect the generated force that is used to throw the ball which could have an effect on the distance at which the ball is thrown.
The null hypothesis is rejected. The p-value of 2.55e-09 is less than alpha of 0.05. This means that there is a significant difference of the mean of the balls.
In continuation to the experimental studies of the Catapult, we are performing a designed experiment to determine the effect of Pin Elevation and Release Angle on distance in which the red ball is thrown when the Bungee Position is fixed at the second position.
The Settings one and three of Pin Elevation will 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 is replicated three times
We identify Two factors: Factor A: Release Angle with 3 levels ( 110, 140, 170) therefore the degrees of freedom for factor A , will be i-1=3-1=2.
Factor B: Pin elevation with 2 levels ( 1 and 3) therefore the degrees of freedom for factor B, will be j-1=2-1=1.
SECTION A: MODEL EQUATION AND HYPOTHESIS
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.
Model Equation
\(Y_{ijkl}\) = \(\mu\) + \(\alpha_i\) + \(\beta_j\) + \(\alpha\beta_{ij}\) + \(\epsilon_{ijkl}\)
Hypothesis:
NUll Hypothesis: \(\alpha\beta_{ij} = 0\) For all {i,j}
Alternative Hypothesis: \(\alpha\beta_{ij} \neq 0\) for some {i,j}
NUll Hypothesis:\(\alpha_i = 0\)
Alternative Hypothesis: \(\alpha_i \neq 0\)
NUll Hypothesis: \(\beta_j=0\)
Alternative Hypothesis: \(\beta_j\neq0\)
SECTION B: RANDOMIZED DESIGN AND LAYOUT
Proposed layout with a randomized run order
trt0<- c(2,3)
design<- design.ab(trt=trt0,r=3,design ="crd",seed=1000)
design$book
## plots r A B
## 1 101 1 1 1
## 2 102 1 1 3
## 3 103 1 2 3
## 4 104 2 1 1
## 5 105 2 1 3
## 6 106 2 2 3
## 7 107 1 1 2
## 8 108 3 2 3
## 9 109 3 1 3
## 10 110 1 2 2
## 11 111 1 2 1
## 12 112 2 2 2
## 13 113 2 2 1
## 14 114 3 2 2
## 15 115 2 1 2
## 16 116 3 1 1
## 17 117 3 1 2
## 18 118 3 2 1
SECTION C: DATA COLLECTION
Data Collection and observations recording on the layout proposed.
obs<-c(27,27,28,42,42,40,59,55,59,
21,30,31,52,47,48,88,83,86)
SECTION D:HYPOTHESIS TEST
library(GAD)
Release_Angle<-c(rep(110,3),rep(140,3),rep(170,3))
Pin_Elevation<-c(rep(1,9),rep(3,9))
obs<-c(27,27,28,42,42,40,59,55,59,
21,30,31,52,47,48,88,83,86)
data.frame(Release_Angle,Pin_Elevation,obs)
## Release_Angle Pin_Elevation obs
## 1 110 1 27
## 2 110 1 27
## 3 110 1 28
## 4 140 1 42
## 5 140 1 42
## 6 140 1 40
## 7 170 1 59
## 8 170 1 55
## 9 170 1 59
## 10 110 3 21
## 11 110 3 30
## 12 110 3 31
## 13 140 3 52
## 14 140 3 47
## 15 140 3 48
## 16 170 3 88
## 17 170 3 83
## 18 170 3 86
Release_Angle<-as.random(Release_Angle)
Pin_Elevation<-as.fixed(Pin_Elevation)
datpr<-data.frame(Release_Angle,Pin_Elevation,obs)
modelpr<-aov(obs~Release_Angle+Pin_Elevation+Release_Angle*Pin_Elevation, data=datpr)
GAD::gad(modelpr)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## Release_Angle 2 5971.4 2985.72 353.5724 2.159e-11 ***
## Pin_Elevation 1 636.1 636.06 2.0253 0.2907
## Release_Angle:Pin_Elevation 2 628.1 314.06 37.1908 7.187e-06 ***
## Residual 12 101.3 8.44
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(modelpr)
## Df Sum Sq Mean Sq F value Pr(>F)
## Release_Angle 2 5971 2985.7 353.57 2.16e-11 ***
## Pin_Elevation 1 636 636.1 75.32 1.62e-06 ***
## Release_Angle:Pin_Elevation 2 628 314.1 37.19 7.19e-06 ***
## Residuals 12 101 8.4
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(modelpr)
Interaction Plot:
interaction.plot(datpr$Release_Angle,datpr$Pin_Elevation,datpr$obs)
The p-value is less than alpha=0.05 , we reject null hypothesis. Significant Factors are: Release_Angle, Pin_Elevation, and two way interaction Release_Angle:Pin_Elevation
From the plot we can see that the spread of the residuals tends to be equal to fitted values. The residual and normality plots show that the variance is approximately constant for our experiment and the model is adequate in terms of normality (see below).
We started by exploring the highest order interaction(\(\alpha\beta_{ij}\)). We observed that the two factor interaction effect is significant under Ho is true. This means that we should stop exploration of the associated factors and we generated the interaction plot of the factors A (Pin_Elevation),B (Bungee_Position), and A:B (Pin_Elevation:Bungee_Position) interaction as shown above. the interaction plot shows that the means of the data are equal at the low level of the release angle.The difference of the means increases significantly at high level of the release angle.
2k Factorial Design
we are Performing a designed experiment to determine the effect of the available factors of Pin Elevation (A), Bungee Position (B), Release Angle(C), and Ball Type (D) on distance in which a ball is thrown. we will Design this experiment as a single replicate of a 24 factorial design with the low and high level of the factors being as follows:
| Factor | Low Level (-1) | High Level (+1) |
|---|---|---|
| A :Pin Elevation | Position 1 | Position 3 |
| B :Bungee Position | Position 2 | Position 3 |
| C :Release Angle | 140 degrees | 170 degrees |
| D :Ball Type | Yellow | Red |
SECTION A: RANDOMIZED DESIGN AND LAYOUT
Propose a data collection layout with a randomized run order**
trt0<-c(rep(2,4))
design<-design.ab(trt=trt0,r=1,design="crd", seed=2000)
design$book
## plots r A B C D
## 1 101 1 2 2 2 1
## 2 102 1 2 2 1 1
## 3 103 1 1 1 1 2
## 4 104 1 1 2 1 2
## 5 105 1 2 2 1 2
## 6 106 1 1 2 2 2
## 7 107 1 1 2 1 1
## 8 108 1 1 1 2 1
## 9 109 1 2 1 1 2
## 10 110 1 1 1 1 1
## 11 111 1 2 2 2 2
## 12 112 1 1 2 2 1
## 13 113 1 2 1 1 1
## 14 114 1 1 1 2 2
## 15 115 1 2 1 2 1
## 16 116 1 2 1 2 2
SECTION B: DATA COLLECTION
obs3<-c(121,99,31,49,55,61,41,34,45,34,133,67,51,37,125,73)
SECTION C: MODEL EQUATION
State model equation and determine what factors/interactions appear to be significant
Model Equation
\(Y_{ijkl}\) = \(\mu\) + \(\alpha_i\) + \(\beta_j\) + \(\gamma_k\) +\(\lambda_l\) + \(\alpha\beta_{ij}\) +\(\alpha\gamma_{ik}\) +\(\alpha\lambda_{il}\)+ \(\beta\gamma_{jk}\)+\(\beta\lambda_{jl}\)+\(\gamma\lambda_{kl}\)+ \(\alpha\beta\gamma_{ijk}\)+\(\alpha\beta\lambda_{ijl}\)+\(\beta\gamma\lambda_{jkl}\)+ \(\alpha\beta\gamma\lambda_{ijkl}\)+ \(\epsilon_{ijklm}\)
Significant factors and interactions including plots
library(DoE.base)
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)
obs3<-c(121,99,31,49,55,61,41,34,45,34,133,67,51,37,125,73)
dat<-data.frame(A,B,C,D,obs3)
dat
## A B C D obs3
## 1 1 1 1 -1 121
## 2 1 1 -1 -1 99
## 3 -1 -1 -1 1 31
## 4 -1 1 -1 1 49
## 5 1 1 -1 1 55
## 6 -1 1 1 1 61
## 7 -1 1 -1 -1 41
## 8 -1 -1 1 -1 34
## 9 1 -1 -1 1 45
## 10 -1 -1 -1 -1 34
## 11 1 1 1 1 133
## 12 -1 1 1 -1 67
## 13 1 -1 -1 -1 51
## 14 -1 -1 1 1 37
## 15 1 -1 1 -1 125
## 16 1 -1 1 1 73
mod1<-lm(obs3~A*B*C*D,data = dat)
coef(mod1)
## (Intercept) A B C D A:B
## 66.000 21.750 12.250 15.375 -5.500 2.000
## A:C B:C A:D B:D C:D A:B:C
## 9.875 1.875 -5.750 1.750 0.125 -2.125
## A:B:D A:C:D B:C:D A:B:C:D
## 1.500 1.125 5.125 7.625
halfnormal(mod1)
From the half Normal Plot: We obtain that Factors: A, C,and B are the significant Factors THerefore our new model equation after we pull up all significant factors is as follow:
\(Y_{ijkl}\) = \(\mu\) + \(\alpha_i\) + \(\beta_j\) + \(\gamma_k\) + \(\alpha\beta_{ij}\) +\(\alpha\gamma_{ik}\) + \(\beta\gamma_{jk}\)+\(\alpha\beta\gamma_{ijk}\)+ \(\epsilon_{ijkl}\)
## WE pull up significant factors A, C, B and their interactions.
mod3<-lm(obs3~A+B+C+A*B+A*C+B*C,data = dat)
coef(mod3)
## (Intercept) A B C A:B A:C
## 66.000 21.750 12.250 15.375 2.000 9.875
## B:C
## 1.875
halfnormal(mod3)
##
## Significant effects (alpha=0.05, Lenth method):
## [1] A C B A:C e8
summary(mod3)
##
## Call:
## lm.default(formula = obs3 ~ A + B + C + A * B + A * C + B * C,
## data = dat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -23.875 -5.375 0.000 3.688 28.125
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 66.000 4.201 15.711 7.54e-08 ***
## A 21.750 4.201 5.177 0.000581 ***
## B 12.250 4.201 2.916 0.017142 *
## C 15.375 4.201 3.660 0.005236 **
## A:B 2.000 4.201 0.476 0.645356
## A:C 9.875 4.201 2.351 0.043256 *
## B:C 1.875 4.201 0.446 0.665902
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 16.8 on 9 degrees of freedom
## Multiple R-squared: 0.8586, Adjusted R-squared: 0.7644
## F-statistic: 9.109 on 6 and 9 DF, p-value: 0.002102
SECTION D: ANOVA
After using insignificant factors/interactions to create an error term, perform ANOVA to determine a final model equation using an alpha \(\alpha\)= 0.05.
mod4<-aov(obs3~A+B+C+A*B+A*C+B*C,data = dat)
summary(mod4)
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 7569 7569 26.806 0.000581 ***
## B 1 2401 2401 8.503 0.017142 *
## C 1 3782 3782 13.395 0.005236 **
## A:B 1 64 64 0.227 0.645356
## A:C 1 1560 1560 5.526 0.043256 *
## B:C 1 56 56 0.199 0.665902
## Residuals 9 2541 282
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Model equation will be:
\(Y_{ijkl}\) = \(\mu\) + \(\alpha_i\) + \(\beta_j\) + \(\gamma_k\) +\(\alpha\gamma_{ik}\)+ \(\epsilon_{ijkl}\)
\(Y_{ijkl}\)= 66.00 + 21.750 A+ 12.250 B+15.375 C+ 9.875 A*C+ 4.201
interaction.plot(dat$A,dat$C,dat$obs3)
Model is significant becuase p-value=0.006251 is less than alpha of 0.05 The F-value of 9.109 indicates that the model is significant. The distance is affected by Factors Pin elevation, Release Angle and Boungee Position and Pin elevation:Release angle interaction. we observed that the main effects of the interaction of A:C (Pin elevation:Release angle) is not vital as other factors. Additionally, the interaction plot shows that the mean of the data shift down at lower level.
From the ANOVA analysis we observe that Factors A (Pin_Elevation), and C(Release_Angle) are the most significant( at 0.001 sign level), factor B (Bungee_Position) is significant at 0.05 significance level with p value of 0.017142. Lastly interaction A:C (Pin elevation:Release angle) is merely significant at 0.05 level with p-value of 0.043256 therefore its effect can be ignored.