Consider the potting experiment in Problem 6.21. Analyze the data considering each replicate as a block.
Let us consider the following norms:
Length of Putter : 10 ft = -1, 30 ft = 1
Type of Putter: mallet = 1, cavity-back = -1
Break of Putt: straight = -1, breaking = 1
Slope of Putt: level = -1, downhill = 1
Entering the data
library(GAD)
## Warning: package 'GAD' was built under R version 4.2.2
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
A<-c(rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7))
B<-c(rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7))
C<-c(rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7))
D<-c(rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7))
Block <- c(rep(1,16),rep(2,16),rep(3,16),rep(4,16),rep(5,16),rep(6,16),rep(7,16))
Obs<-c(10,18,14,12.5,19,16,18.5, 0,16.5,4.5,17.5,20.5,17.5,33, 4,6,1,14.5,12,14,5, 0,10,34,11,25.5,21.5,0, 0,0,18.5,19.5,16,15,11, 5,20.5,18,20,29.5,19,10, 6.5,18.5,7.5,6,0,10,0, 16.5,4.5,0,23.5,8,8,8, 4.5,18,14.5,10,0,17.5,6, 19.5,18,16,5.5,10,7,36, 15,16,8.5,0,0.5,9,3, 41.5,39,6.5,3.5,7,8.5,36, 8,4.5,6.5,10,13,41,14, 21.5,10.5,6.5,0,15.5,24,16, 0,0,0,4.5,1,4,6.5, 18,5,7,10,32.5,18.5,8)
A<-as.fixed(A)
B<-as.fixed(B)
C<-as.fixed(C)
D<-as.fixed(D)
Block<-as.fixed(Block)
dat1<-data.frame(A,B,C,D,Block)
Analyzing
model1<-lm(Obs~A*B*C*D+Block,data = dat1)
model2<-aov(model1)
summary(model2)
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 388 388.1 4.558 0.03549 *
## B 1 917 917.1 10.769 0.00147 **
## C 1 1 1.4 0.016 0.89844
## D 1 145 145.1 1.704 0.19505
## Block 6 189 31.5 0.370 0.89608
## A:B 1 544 544.4 6.393 0.01320 *
## A:C 1 14 14.2 0.167 0.68378
## B:C 1 12 12.2 0.144 0.70560
## A:D 1 96 96.5 1.133 0.28997
## B:D 1 12 11.9 0.140 0.70895
## C:D 1 97 96.7 1.136 0.28944
## A:B:C 1 116 116.0 1.362 0.24631
## A:B:D 1 37 36.7 0.431 0.51320
## A:C:D 1 120 120.0 1.409 0.23831
## B:C:D 1 199 199.3 2.340 0.12962
## A:B:C:D 1 0 0.5 0.006 0.94022
## Residuals 90 7665 85.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We will reject the null hypothesis in this case because all the p values are greater than alpha 0.05 except A, B which are not significant.
We will now try using two significant effects
model3<-lm(Obs~A+B+C+D+Block,data = dat1)
model4<-aov(model3)
summary(model4)
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 388 388.1 4.398 0.0385 *
## B 1 917 917.1 10.393 0.0017 **
## C 1 1 1.4 0.016 0.9002
## D 1 145 145.1 1.645 0.2026
## Block 6 189 31.5 0.357 0.9041
## Residuals 101 8913 88.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We got almost the same values of p.