a) Propose a data collection layout with a randomized run order

library(agricolae)
trts<-c(2,2,2,2)
design.ab(trt=trts, r=1, design="crd",seed=158632)
## $parameters
## $parameters$design
## [1] "factorial"
## 
## $parameters$trt
##  [1] "1 1 1 1" "1 1 1 2" "1 1 2 1" "1 1 2 2" "1 2 1 1" "1 2 1 2" "1 2 2 1"
##  [8] "1 2 2 2" "2 1 1 1" "2 1 1 2" "2 1 2 1" "2 1 2 2" "2 2 1 1" "2 2 1 2"
## [15] "2 2 2 1" "2 2 2 2"
## 
## $parameters$r
##  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
## 
## $parameters$serie
## [1] 2
## 
## $parameters$seed
## [1] 158632
## 
## $parameters$kinds
## [1] "Super-Duper"
## 
## $parameters[[7]]
## [1] TRUE
## 
## $parameters$applied
## [1] "crd"
## 
## 
## $book
##    plots r A B C D
## 1    101 1 1 1 1 1
## 2    102 1 1 1 1 2
## 3    103 1 2 1 2 1
## 4    104 1 2 2 2 2
## 5    105 1 1 2 2 1
## 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 2 2 2 1
## 11   111 1 2 1 1 1
## 12   112 1 2 2 1 1
## 13   113 1 2 2 1 2
## 14   114 1 1 2 1 2
## 15   115 1 2 1 2 2
## 16   116 1 1 1 2 2

The proposed design is showed above.

b) Collect data and record observations

The data was collected during the class.

c) State model equation and determine what factors/interactions appear to be significant (show any plots that were used in making this determination)

The Model equation for a 2^4 Factorial design is showed below.

\(Y_{ijklm}=\mu+\alpha_{i}+\beta_{j}+\gamma_{k}+\delta_{l}+\alpha\beta_{ij}+\alpha\gamma_{ik}+\alpha\delta_{il}+\beta\gamma_{jk}+\beta\delta_{jl}+\gamma\delta_{kl}+\alpha\beta\gamma_{ijk}+\alpha\beta\delta_{ijl}+\alpha\gamma\delta_{ikl}+\beta\gamma\delta_{jkl}+\alpha\beta\gamma\delta_{ijkl}+\epsilon_{ijklm}\)

Verifying the Halfnormal plot

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.
library(DoE.base)
## Loading required package: grid
## Loading required package: conf.design
## Registered S3 method overwritten by 'DoE.base':
##   method           from       
##   factorize.factor conf.design
## 
## Attaching package: 'DoE.base'
## The following objects are masked from 'package:stats':
## 
##     aov, lm
## The following object is masked from 'package:graphics':
## 
##     plot.design
## The following object is masked from 'package:base':
## 
##     lengths
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)
obs<-c(36,30,75,58,48,41,37,42,43,103,48,40,43,37,54,35)

model<-lm(obs~A*B*C*D)
coef(model)
## (Intercept)           A           B           C           D         A:B 
##      48.125       9.875       2.750       8.875      -5.500       0.250 
##         A:C         B:C         A:D         B:D         C:D       A:B:C 
##       5.625       2.750      -3.000      -0.625      -4.500       2.250 
##       A:B:D       A:C:D       B:C:D     A:B:C:D 
##      -1.375      -3.500      -2.375      -1.625
halfnormal(model)
## 
## Significant effects (alpha=0.05, Lenth method):
## [1] A

Analysis

From the halfnormal plot we can see that only Factor A (Pin Elevation) appears to be significant.

d) After using insignificant factors/interactions to create an error term, perform ANOVA to determine a final model equation using an alpha = 0.05

A<-as.fixed(A)
model1<-aov(obs~A)
gad(model1)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq F value  Pr(>F)  
## A         1 1560.2 1560.25  6.4104 0.02394 *
## Residual 14 3407.5  243.39                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Analysis

The analysis of variance provided the p-value=0.02394 less than alpha=0.05. We conclude that only factor A (Pin Elevation) has a significant effect on the distance in which a ball is thrown.

Final model equation: \(Y_{im}=\mu+\alpha_{i}+\epsilon_{im}\)

All Code

library(agricolae)
trts<-c(2,2,2,2)
design.ab(trt=trts, r=1, design="crd",seed=158632)
library(GAD)
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)
obs<-c(36,30,75,58,48,41,37,42,43,103,48,40,43,37,54,35)
model<-lm(obs~A*B*C*D)
coef(model)
halfnormal(model)
A<-as.fixed(A)
model1<-aov(obs~A)
gad(model1)