y <- c(12, 30, 10, 18, 24, 32, 29, 26, 9, 9, 16, 4, 30, 7, 21, 9, 16, 10, 18, 18, 18, 24, 12, 19, 10, 4, 4, 5, 17, 7, 16, 17) Treatment <- factor(c(rep(1,8),as.numeric(gl(6,4,24))+1)) mod <- lm(y ~ Treatment) print(anova(mod))