Part - 02.

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 90, 110, and 120 degrees as a random effect. The design should be replicated three times.

The given setting of Pin Elevation and Release Angle gives us ideal choose of considered them as factors and the factorial design could be used for analysis the whole experiment, the factors with different setting in them is treated as levels in the factors. The Pin Elevation(A) has setting one and three which could be considered as two levels, similarly the Release Angle(B) which has three levels representing three different angles.

a) Proposing a layout with a randomized run order

The factorial desing layout with no source of nuisance.

The Arguments of the layout generation for the factorial design are:

Treatments (trt): The number of factor levels in each factor

Replications (r): The number of times each factor level combinations need to be replicated

Layout generation

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)

Where;

A: Pin Elevation; \(1: 1^{st}position\), \(2: 3^{rd}position\).

B: Release angle; \(1: 90^{0}\), \(2: 110^{0}\),\(3: 120^{0}\).

c) Collect data and record observations on the layout proposed in part (a)

The observations are collected according to the layout generated with different factor level combinations and required number of replications.

Entering the collected data for analysis

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.

Model Equation.

\(y_{ijk} = \mu + \alpha_i + \beta_j + \alpha\beta_{ij} + \epsilon_{ijk}\)

Where;

\(y_{ijk}\) = Observed response of each factor level combination

\(\mu\) = Grand Mean (Mean of entire populations)

Controllable errors

\(\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

Uncontrollable errors

\(\epsilon_{ijk}\) = Random Error which is distributed Normally (0,1)

The hypothesis is tested for the Controllable errors, so that we could work on it to reduce the error based on the obtained results of analysis.

Hypothesis to be tested:

Factor - 1 : Pin Elevation

Null Hypothesis (\(H_o\)):

\(\alpha_i = 0\space\forall\space i\)

Alternate Hypothesis (\(H_a\)):

\(\alpha_i \neq 0\space some \space i\)

Factor - 2 : Release Angle.

Null Hypothesis (\(H_o\)):

\(\beta_j = 0\space\forall\space j\)

Alternate Hypothesis (\(H_a\)):

\(\beta \neq 0\space some \space j\)

Interaction.

Null Hypothesis (\(H_o\)):

\(\alpha\beta_{ij} = 0\space\forall\space ij\)

Alternate Hypothesis (\(H_a\)):

\(\alpha\beta_{ij} \neq 0 \space some \space ij\)

Level of significance = 0.05.

The Hypothesis is tested considering the higher order interaction first, then the lower order interactions and the main effects; this gives us the idea that which interactions are affecting the results of ANOVA.

d) Testing the hypotheses and state conclusions, determining those effects that are significant. Showing any plots that might be useful/necessary to show the 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).

Testing the hypothesis.

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.

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")

\(\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.

Now we need to Test for main effects if they make sence or not

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.

Residuals plots

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.)

Source Code

# 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)