Treatments (trt): The number of factor levels in each factor
Replications (r): The number of times each factor level combinations need to be replicated
trts<-c(2,3)
library(agricolae)
design.ab(trt=trts,r=3,design="crd",seed=63737)
## $parameters
## $parameters$design
## [1] "factorial"
##
## $parameters$trt
## [1] "1 1" "1 2" "1 3" "2 1" "2 2" "2 3"
##
## $parameters$r
## [1] 3 3 3 3 3 3
##
## $parameters$serie
## [1] 2
##
## $parameters$seed
## [1] 63737
##
## $parameters$kinds
## [1] "Super-Duper"
##
## $parameters[[7]]
## [1] TRUE
##
## $parameters$applied
## [1] "crd"
##
##
## $book
## plots r A B
## 1 101 1 2 2
## 2 102 1 1 2
## 3 103 1 2 3
## 4 104 1 1 3
## 5 105 1 1 1
## 6 106 2 1 3
## 7 107 2 2 3
## 8 108 2 2 2
## 9 109 2 1 1
## 10 110 3 1 1
## 11 111 2 1 2
## 12 112 3 2 2
## 13 113 3 1 3
## 14 114 3 2 3
## 15 115 1 2 1
## 16 116 2 2 1
## 17 117 3 2 1
## 18 118 3 1 2
# A correspond to Pin Elevation(2levels) ie (1st, 3rd positions)
# B corresponds to Release Angle(3levels) ie (90,110,120)
A: Pin Elevation; \(1: 1^{st}position\), \(2: 3^{rd}position\).
B: Release angle; \(1: 90^{0}\), \(2: 110^{0}\),\(3: 120^{0}\).
library(readxl)
Pdat<-read_excel("C:/Users/Saipa/OneDrive/Desktop/DOE/Projectdata2.xlsx")
print(Pdat)
## # A tibble: 18 x 3
## Position Angle Observation
## <chr> <dbl> <dbl>
## 1 3rd elevation 110 39
## 2 1st elevation 110 57
## 3 3rd elevation 120 18
## 4 1st elevation 120 37
## 5 1st elevation 90 45
## 6 1st elevation 120 39
## 7 3rd elevation 120 12
## 8 3rd elevation 110 25
## 9 1st elevation 90 45
## 10 1st elevation 90 43
## 11 1st elevation 110 45
## 12 3rd elevation 110 28
## 13 1st elevation 120 28
## 14 3rd elevation 120 7
## 15 3rd elevation 90 18
## 16 3rd elevation 90 23
## 17 3rd elevation 90 25
## 18 1st elevation 110 48
\(\underline{Comments}\): The normal probability plot and the box plot of the observation can’t be plot because of each factor level combination has only three values, this sample size is small to plot and draw conclusion on the normality and the constant variance respectively.
\(y_{ijk}\) = Observed response of each factor level combination
\(\mu\) = Grand Mean (Mean of entire populations)
\(\alpha_i\) = Main effect of the factor Pin Elevations
\(\beta_j\) = Main effect of factor Release Angle
\(\alpha\beta_{ij}\) = Interactions effect between the factors
\(\epsilon_{ijk}\) = Random Error which is distributed Normally (0,1)
\(\alpha_i = 0\space\forall\space i\)
\(\alpha_i \neq 0\space some \space i\)
\(\beta_j = 0\space\forall\space j\)
\(\beta \neq 0\space some \space j\)
\(\alpha\beta_{ij} = 0\space\forall\space ij\)
\(\alpha\beta_{ij} \neq 0 \space some \space ij\)
library("GAD")
Pdat$Angle<-as.random(Pdat$Angle)
Pdat$Position<-as.fixed(Pdat$Position)
model<-aov(Observation~Position*Angle,data=Pdat)
gad(model)
\(\underline{Comments}\):Fail to reject Null-hypothesis that interaction term is not significant.By interaction plot also you can actually see from Angle 110 to 120 as that observation are in decreasing pattern for both of them ie interaction of both of them is not explaining any thing about the model.
library(ggplot2)
ggplot() +
aes(x =Pdat$Angle, color = Pdat$Position, group = Pdat$Position, y = Pdat$Observation) +
stat_summary(fun= mean, geom = "point") +
stat_summary(fun= mean, geom = "line")
\(\underline{Comments}\):Fail to reject Null-hypothesis that interaction term is not significant. The results give us that the interaction between the Pin Elevation and Release Angle are not significant,By interaction plot also you can actually see from Angle 110 to 120 as that observation are in decreasing pattern for both of them ie interaction of both of them is not explaining any thing about the model. So we failed to reject Null hypothesis for interaction term.
model1<-aov(Observation~Position+Angle,data=Pdat)
gad(model1)
\(\underline{Comments} , \underline{Conculsion}\):Main effects make sense they are affecting the Model as p value is very small for both of them.We can reject the null Hypothesis.The analysis gives us that The two Main Effects Pin Elevation and the Release angle has significant effect on the distance to which the ball is thrown.
plot(model1)
\(\underline{Comments} , \underline{Conculsion}\): First of all they are no enough points in-order to comment on Normality and Model Adequacy. In residual vs Fitted graph we can see that there is no strong pattern observed ie residuals are randomly distributed across zero residual Line. ie We can assume the model is Adequate(Constant Variance)(Judgemental Call only Assumption). Normal probability plot of residuals is almost normally distributed with one tail out drifted(13th observation.)
# Design Layout and Loading Data
trts<-c(2,3)
library(agricolae)
design.ab(trt=trts,r=3,design="crd",seed=63737)
# A correspond to Pin Elevation(2levels) ie (1st, 3rd positions)
# B corresponds to Release Angle(3levels) ie (90,110,120)
library(readxl)
Pdat<-read_excel("C:/Users/Saipa/OneDrive/Desktop/DOE/Projectdata2.xlsx")
print(Pdat)
# Model
library("GAD")
Pdat$Angle<-as.random(Pdat$Angle)
Pdat$Position<-as.fixed(Pdat$Position)
model<-aov(Observation~Position*Angle,data=Pdat)
gad(model)
# Interaction Plots
library(ggplot2)
ggplot() +
aes(x =Pdat$Angle, color = Pdat$Position, group = Pdat$Position, y = Pdat$Observation) +
stat_summary(fun= mean, geom = "point") +
stat_summary(fun= mean, geom = "line")
# Model Summary
model1<-aov(Observation~Position+Angle,data=Pdat)
gad(model1)
# Residual Plots
plot(model1)