a) 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.
Ho: \(\alpha_{i} = 0\) - Null Hypothesis
Ha: \(\alpha_{i} \ne 0\) - Alternative Hypothesis
Ho: \(\beta_{i} = 0\) - Null Hypothesis
Ha: \(\beta_{i} \ne 0\) - Alternative Hypothesis
Ho: \(\alpha \beta_{ij} = 0\) - Null Hypothesis
Ha: \(\alpha \beta_{ij} \ne 0\) - Alternative Hypothesis
level of significance
\(\alpha\) = 0.05
Model Equation
\(y_{ijk} = \mu + \alpha_{i} + \beta_j + \alpha \beta_{ij} + \epsilon_{ijk}\)
b) Propose a layout with a randomized run order
library(agricolae)
#?design.ab
trts<-c(2,3)
design<-design.ab(trt=trts, r=3, design="crd",seed=878900)
design$book
## plots r A B
## 1 101 1 1 2
## 2 102 2 1 2
## 3 103 1 2 3
## 4 104 1 2 1
## 5 105 1 1 1
## 6 106 2 2 1
## 7 107 1 1 3
## 8 108 1 2 2
## 9 109 3 2 1
## 10 110 2 1 3
## 11 111 3 1 2
## 12 112 2 2 3
## 13 113 2 2 2
## 14 114 3 2 2
## 15 115 3 2 3
## 16 116 2 1 1
## 17 117 3 1 1
## 18 118 3 1 3
In the layout, factor A(Pin.Location) represents Pin Elevation and it has levels 1 and 2 for settings 1 and 3 respectively. factor B(Angle) represents the Release Angle with levels 1,2 and 3 for corresponding angles 110, 140 and 170 degrees. Number of replications is 3 which gives a total of 18 observations in the experiment
c) Collect data and record observations on the layout proposed in part (a)
BungeeEx<-read.csv("https://raw.githubusercontent.com/Rusty1299/Projects/main/Factorial%20Design%20Project.csv")
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
BungeeEx$Pin.Location<-as.fixed(BungeeEx$Pin.Location)
BungeeEx$Angle<-as.random(BungeeEx$Angle)
str(BungeeEx)
## 'data.frame': 18 obs. of 4 variables:
## $ Replication : int 1 2 1 1 1 2 1 1 3 2 ...
## $ Pin.Location : Factor w/ 2 levels "1","3": 1 1 2 2 1 2 1 2 2 1 ...
## $ Angle : Factor w/ 3 levels "110","140","170": 2 2 3 1 1 1 3 2 1 3 ...
## $ Distance...Inches.: int 25 35 55 32 24 23 48 36 24 56 ...
BungeeEx
## Replication Pin.Location Angle Distance...Inches.
## 1 1 1 140 25
## 2 2 1 140 35
## 3 1 3 170 55
## 4 1 3 110 32
## 5 1 1 110 24
## 6 2 3 110 23
## 7 1 1 170 48
## 8 1 3 140 36
## 9 3 3 110 24
## 10 2 1 170 56
## 11 3 1 140 37
## 12 2 3 170 61
## 13 2 3 140 52
## 14 3 3 140 48
## 15 3 3 170 72
## 16 2 1 110 30
## 17 3 1 110 26
## 18 3 1 170 33
d) Test the hypotheses and state conclusions, determining those effects that are significant.
model<-aov(BungeeEx$Distance...Inches.~BungeeEx$Pin.Location*BungeeEx$Angle)
gad(model)
## Analysis of Variance Table
##
## Response: BungeeEx$Distance...Inches.
## Df Sum Sq Mean Sq F value Pr(>F)
## BungeeEx$Pin.Location 1 440.06 440.06 3.5616 0.1997555
## BungeeEx$Angle 2 2305.33 1152.67 19.4817 0.0001704 ***
## BungeeEx$Pin.Location:BungeeEx$Angle 2 247.11 123.56 2.0883 0.1666387
## Residual 12 710.00 59.17
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
First we test the interaction hypothesis and if we fail to reject we the null hypothesis Ho, then we test the main effects. From the result, interaction effects has /fo/ is 2.0883 with a correspondingp-value of 0.1666387 > \(\alpha\) = 0.05. Hence we fail to reject Ho hypothesis that the means are equal. Next we test the main effects
Model Equation
\(y_{ijk} = \mu + \alpha_{i} + \beta_j + \epsilon_{ijk}\)
model<-aov(BungeeEx$Distance...Inches.~BungeeEx$Pin.Location+BungeeEx$Angle)
gad(model)
## Analysis of Variance Table
##
## Response: BungeeEx$Distance...Inches.
## Df Sum Sq Mean Sq F value Pr(>F)
## BungeeEx$Pin.Location 1 440.06 440.06 6.4368 0.023703 *
## BungeeEx$Angle 2 2305.33 1152.67 16.8605 0.000187 ***
## Residual 14 957.11 68.37
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the result /fo/ is 6.4368 with a corresponding significant p-value of 0.023703 < \(\alpha\) = 0.05. Hence we reject Ho hypothesis that the means are equal.
Effects that are significant
Pin.Location 0.023703 < \(\alpha\) = 0.05
Angle 0.000187 < \(\alpha\) = 0.05
Show any plots that might be useful/necessary to show your findings.
interaction.plot(BungeeEx$Angle,BungeeEx$Pin.Location,BungeeEx$Distance...Inches., type = "l", col = 5:7 ,main ="Interraction Plot", ylab = "Distance", xlab = "Release Angles", trace.label = "Pin Elevation", lwd = 3, lty = 1)
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)
plot(model)
There seems to be nothing unusaual about the plots. Normal plot seems to be on a straight line with 2 extreme outliers on the tail ends of the data distribution. Other than that, everything is fairly normal. We can do a boxplot to further examine the data distribution.
boxplot(BungeeEx$Distance...Inches.~BungeeEx$Angle, col = 6:9:3, main = "Boxplot for Relaease Angle", xlab = "Release Angle", ylab = "Distance")
## Warning in 6:9:3: numerical expression has 4 elements: only the first used
The boxplot for release angle
boxplot(BungeeEx$Distance...Inches.~BungeeEx$Pin.Location, col = 2:4, main = "Boxplot for Pin Elevation", xlab = "Pin Elevation", ylab = "Distance")
trts<-c(2,3)
design<-design.ab(trt=trts, r=3, design="crd",seed=878900)
design$book
BungeeEx<-read.csv("https://raw.githubusercontent.com/Rusty1299/Projects/main/Factorial%20Design%20Project.csv")
library(GAD)
BungeeEx$Pin.Location<-as.fixed(BungeeEx$Pin.Location)
BungeeEx$Angle<-as.random(BungeeEx$Angle)
model<-aov(BungeeEx$Distance...Inches.~BungeeEx$Pin.Location*BungeeEx$Angle)
gad(model)
model<-aov(BungeeEx$Distance...Inches.~BungeeEx$Pin.Location+BungeeEx$Angle)
gad(model)
interaction.plot(BungeeEx$Angle,BungeeEx$Pin.Location,BungeeEx$Distance...Inches., type = "l", col = 5:7 ,main ="Interraction Plot", ylab = "Distance", xlab = "Release Angles", trace.label = "Pin Elevation", lwd = 3, lty = 1)
plot(model)
boxplot(BungeeEx$Distance...Inches.~BungeeEx$Angle, col = 6:9:3, main = "Boxplot for Relaease Angle", xlab = "Release Angle", ylab = "Distance")
boxplot(BungeeEx$Distance...Inches.~BungeeEx$Pin.Location, col = 2:4, main = "Boxplot for Pin Elevation", xlab = "Pin Elevation", ylab = "Distance")