Question 1A

obs<-c(21,20,25,22,21,22,22,24,24,23,21,25,23,24,24,28,28,25,29,29,27,30,29,29,29,30,26,26,26,28,23,23,23,21,21,22,20,22,22,22,19,19,21,18,18)
type<-c(rep(1,15),rep(2,15),rep(3,15))
type<-as.factor(type)
dat<-cbind(obs,type)
dat<-data.frame(dat)
dat$type<-as.factor(type)
str(dat)
## 'data.frame':    45 obs. of  2 variables:
##  $ obs : num  21 20 25 22 21 22 22 24 24 23 ...
##  $ type: Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ...
boxplot(obs~type,main="box plot of basic,conehead, buckethead",data=dat)

from the box-plot, were cam see that the variance appears to be constant. But the all have different mean values.

Question 10b Question 2 Null hypotheis is that H0:t1=0( when means that the mean values of the basic,conehead, buckethead are the same alternative hypothesis

Ha=t1 is not equals to zero is that alteast one of the mean differs

model<-aov(obs~type,data =dat)
summary(model)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## type         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

Based on the p-value of 1.79e-14,We are rejecting Ho and stating that atleast one of the mean differs.

Question 10 c

plot(model)

We can see from the Normal probability plot that the data is normaly distributed Since it all the data points follows a straight line

We can also see that the variance is constant since All the residuals have the same spread, which is showing constant variance

Question 10 d

TukeyHSD(model,conf.level =0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = obs ~ type, data = dat)
## 
## $type
##     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
plot(TukeyHSD(model))

Question 10 d We can see that only 3-1 and also 3-2 are significant since they do not fall within the zero interval

This means that the mean of buckethead and basic are significant

Also This means that the mean of buckethead and conehead are significant

But buckethead and basic are not significant since they fall within the zero interval