#Import the data set labeled as cocowater-1 (note that your data set has headers). Assign to the vector= df1
df2<-read.table("TIME.txt", header=TRUE)
#The data needs to be converted into a single vector. Use the as.matrix function on the vector, then transpose by using the “t” function as you concatenate and assign to r
r<-c(t(as.matrix(df2)))
# Assign to f the treatment levels to f
f<-c("T1", "T2", "T3", "T4", "T5")
#Assign to k the number of treatment levels
k<- 5
#Assign to n the number of observations per treatments
n<-12
#Generate levels using the gl function on the basis of:
#Number of treatment levels
#Number of primary factors
#n*k
#factors as the treatment levels
tm<-gl(k, 1, n*k, factor(f))
#Subject to anova using the aov function the data set you have established (r) to the treatment factors (tm)
av2<- aov(r~tm)
summary(av2)
## Df Sum Sq Mean Sq F value Pr(>F)
## tm 4 77980 19495 57.35 <2e-16 ***
## Residuals 55 18697 340
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(av2)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = r ~ tm)
##
## $tm
## diff lwr upr p adj
## T2-T1 -1.25000 -22.478999 19.97900 0.9998239
## T3-T1 52.50000 31.271001 73.72900 0.0000000
## T4-T1 64.91667 43.687668 86.14567 0.0000000
## T5-T1 89.25000 68.021001 110.47900 0.0000000
## T3-T2 53.75000 32.521001 74.97900 0.0000000
## T4-T2 66.16667 44.937668 87.39567 0.0000000
## T5-T2 90.50000 69.271001 111.72900 0.0000000
## T4-T3 12.41667 -8.812332 33.64567 0.4730601
## T5-T3 36.75000 15.521001 57.97900 0.0000895
## T5-T4 24.33333 3.104335 45.56233 0.0170039