data <- matrix(scan(),ncol=3,byrow=TRUE) 1 1 5.03 1 1 5.1 1 1 5.25 1 1 4.98 1 1 5.05 1 2 4.64 1 2 4.73 1 2 4.82 1 2 4.95 1 2 5.06 1 3 5.1 1 3 5.15 1 3 5.2 1 3 5.08 1 3 5.14 2 1 5.05 2 1 4.96 2 1 5.12 2 1 5.12 2 1 5.05 2 2 5.46 2 2 5.15 2 2 5.18 2 2 5.18 2 2 5.11 2 3 4.9 2 3 4.95 2 3 4.86 2 3 4.86 2 3 5.07 data nestex <- data.frame(data) colnames(nestex) <- c("site","batch","drug") rm(data) nestex nestex$site <- as.factor(nestex$site) nestex$batch <- as.factor(nestex$batch) aov(drug~site+Error(site/batch),data=nestex)