Question 1: Create a side-by-side box plot of the collected data. Make preliminary comments
Entering the data
Basic<-c(21,20,25,22,21,22,22,24,24,23,21,25,23,24,24)
Conehead<-c(28,28,25,29,29,27,30,29,29,29,30,26,26,26,28)
Buckethead<-c(23,23,23,21,21,22,20,22,22,22,19,19,21,18,18)
dat<-data.frame(Basic,Conehead,Buckethead)
boxplot(Basic,Conehead,Buckethead, data= dat, main="Boxplot of Zombies")
Comment: From the boxplot we can see that there is constant variance because the size of all the boxes are equal but the means are different.
Question2:
Test the hypothesis that the means are equal versus the alternative that at least one differs at an alpha=0.05 level of significance. Be sure to state the null and alternative hypotheses and conclusions.
Null Hypothesis: All means are equal
Alternate Hypothesis: Some means differ
library(tidyr)
dat<-stack(dat)
model<-aov(values~ind,data = dat)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## ind 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
Since the p value is less than alpha specified therefore, we reject the null hypothesis and state that some means differ.
Question 3 Comment on the equality of variances and normality of data. Be sure to show supporting plots
plot(model)
From the “Residuals vs Fitted” graph we see that there is constant variance because the spread of residuals is almost the same.
From the normality chart our data doesn’t look to be perfectly normal because all the data points do not lie in a straight line.
Question 4
Assuming the hypothesis is rejected, determine which pairs of means significantly differ at alpha=0.05 using Tukey’s HSD test. Be sure to state conclusions and show supporting plots.
x<-TukeyHSD(model,conf.level = 0.95)
plot(x)
From the Tukeys Test we clearly see that none of the means comparison has 0 in their range.
Therefore, we all the means differ.