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)
data<-c(Basic,Conehead,Buckethead)
x<-c(rep(1,15),rep(2,15),rep(3,15))
x<-as.factor(x)
#Question 1
boxplot(Basic,Conehead,Buckethead)
#from the box plot the variance is not constant
library(tidyr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
model<-aov(data~x)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## x 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
#from the annova test we get p value less than the level of signifance we reject null hypothesis
plot(model)
#By doing annova all the plots are normall
library(car)
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
##
## recode
TukeyHSD(model)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = data ~ x)
##
## $x
## diff lwr upr p adj
## 2-1 5.2 3.746165 6.6538348 0.0000000
## 3-1 -1.8 -3.253835 -0.3461652 0.0120723
## 3-2 -7.0 -8.453835 -5.5461652 0.0000000
#there is signicificant difference between 2 and 1 pair