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

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)