library(dplyr)
library(tidyr)
library(GAD)
library(DoE.base)
Consider the putting experiment in Problem 6.21. Analyze the data considering each replicate as a block.
dat712 <- read.csv("~/Grad School/IE 5342/Homework/7.12Data.csv",header=TRUE)
dat712model1 <- aov(Response~PuttLength*PutterType*PuttBreak*PuttSlope, data = dat712)
summary(dat712model1)
## Df Sum Sq Mean Sq F value Pr(>F)
## PuttLength 1 917 917.1 10.588 0.00157 **
## PutterType 1 388 388.1 4.481 0.03686 *
## PuttBreak 1 145 145.1 1.676 0.19862
## PuttSlope 1 1 1.4 0.016 0.89928
## PuttLength:PutterType 1 219 218.7 2.525 0.11538
## PuttLength:PuttBreak 1 12 11.9 0.137 0.71178
## PutterType:PuttBreak 1 115 115.0 1.328 0.25205
## PuttLength:PuttSlope 1 94 93.8 1.083 0.30066
## PutterType:PuttSlope 1 56 56.4 0.651 0.42159
## PuttBreak:PuttSlope 1 2 1.6 0.019 0.89127
## PuttLength:PutterType:PuttBreak 1 7 7.3 0.084 0.77294
## PuttLength:PutterType:PuttSlope 1 113 113.0 1.305 0.25623
## PuttLength:PuttBreak:PuttSlope 1 39 39.5 0.456 0.50121
## PutterType:PuttBreak:PuttSlope 1 34 33.8 0.390 0.53386
## PuttLength:PutterType:PuttBreak:PuttSlope 1 96 95.6 1.104 0.29599
## Residuals 96 8316 86.6
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The p-values for Putt Length and Putter Type are <0.05, so they are significant factors.
dat712model2 <- aov(Response~PuttLength*PutterType*PuttBreak*PuttSlope+Block, data = dat712)
summary(dat712model2)
## Df Sum Sq Mean Sq F value Pr(>F)
## PuttLength 1 917 917.1 10.492 0.00165 **
## PutterType 1 388 388.1 4.440 0.03773 *
## PuttBreak 1 145 145.1 1.660 0.20067
## PuttSlope 1 1 1.4 0.016 0.89974
## Block 1 6 6.1 0.069 0.79300
## PuttLength:PutterType 1 219 218.7 2.502 0.11705
## PuttLength:PuttBreak 1 12 11.9 0.136 0.71303
## PutterType:PuttBreak 1 115 115.0 1.316 0.25423
## PuttLength:PuttSlope 1 94 93.8 1.073 0.30287
## PutterType:PuttSlope 1 56 56.4 0.646 0.42371
## PuttBreak:PuttSlope 1 2 1.6 0.019 0.89176
## PuttLength:PutterType:PuttBreak 1 7 7.3 0.083 0.77395
## PuttLength:PutterType:PuttSlope 1 107 106.9 1.223 0.27147
## PuttLength:PuttBreak:PuttSlope 1 51 50.9 0.583 0.44715
## PutterType:PuttBreak:PuttSlope 1 34 33.8 0.386 0.53573
## PuttLength:PutterType:PuttBreak:PuttSlope 1 96 95.6 1.094 0.29821
## Residuals 95 8304 87.4
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
With blocking, we get very similar p-values for Putt Length and PutterType. Due to none of the other interactions being significant, let’s now consider just Putt Length and Putter Type.
dat712model3 <- aov(Response~PuttLength*PutterType+Block, data = dat712)
summary(dat712model3)
## Df Sum Sq Mean Sq F value Pr(>F)
## PuttLength 1 917 917.1 10.922 0.00129 **
## PutterType 1 388 388.1 4.623 0.03381 *
## Block 1 46 45.6 0.543 0.46260
## PuttLength:PutterType 1 219 218.7 2.604 0.10952
## Residuals 107 8985 84.0
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Again, we get similar p-values for Putt Length and Putter Type and conclude that they are significant. The block itself is not significant as its p-value is >0.05.
plot(dat712model3,2)
plot(dat712model3,1)
The data appears to be normal until reaching the higher quantiles, and at that point it loses normality. The residuals vs. fitted plot shows that the data does not have constant variance. Thus, the model is inadequate.