1 Question 4

1.1 Item 1

The mean deaths between each type of zombies seems to differ but the variance seems to be pretty similar, which might be a initial guess about the validity of using ANOVA.

library(readxl)
dat <- read_excel(file.choose())
boxplot(dat$Basic,dat$Conehead,dat$Buckethead)

1.2 Item 2

The hypotheses testing can be written as:

\[ H_0: \tau_i=0 \\ H_a: \text{At least one mean differs}\] We can see from the ANOVA test that the null hypotheses is rejected at an \(\alpha\) level of 0.05.

library(tidyr)
dat <- pivot_longer(dat,c("Basic","Conehead","Buckethead"))
aov.model <- aov(dat$value~dat$name)
summary(aov.model)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## dat$name     2  396.4  198.20    73.8 1.79e-14 ***
## Residuals   42  112.8    2.69                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

1.3 Item 3

From the residuals vs fitted values plot we can see that the assumption of equal variances is fair enough to proceed with the test. Moreover, from the normal Q-Q plot, the data does not seems to lie on a perfect straight line. However, since the ANOVA is robust against fair violations of normality, we can assume that the test is valid.

plot(aov.model,1)

plot(aov.model,2)

1.4 Item 4

From the Tukey test, there was a signifcant different between means of the conehead to the basic and between conehead to the buckethead. However, Buckethead and basic did not differ significantly. This can also be seen in the plot, where the two intervals overlap.

TukeyHSD(aov.model,conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = dat$value ~ dat$name)
## 
## $`dat$name`
##                     diff       lwr        upr     p adj
## Buckethead-Basic    -1.8 -3.253835 -0.3461652 0.0120723
## Conehead-Basic       5.2  3.746165  6.6538348 0.0000000
## Conehead-Buckethead  7.0  5.546165  8.4538348 0.0000000
plot(TukeyHSD(aov.model,conf.level = 0.95))