data <- matrix(scan(),ncol=2,byrow=TRUE) 1 88. 1 88. 1 94.8 1 90. 1 93.0 1 89. 1 86. 1 92.9 1 89. 1 93. 2 85.9 2 88.6 2 90. 2 87.1 2 85.6 2 86. 2 91. 2 89.6 2 93. 2 87.5 3 94.2 3 91.5 3 92. 3 96.5 3 95.6 3 93.8 3 92.5 3 93.2 3 96.2 3 92.5 data alloys <- data.frame(data) colnames(alloys) <- c("casting","strength") rm(data) alloys$casting <- as.factor(alloys$casting) # to get variance component estimates library(nlme) alloys.lme <- lme(strength ~ 1, data = alloys, random = ~ 1 | casting ) # to get the ANOVA table anova(lm(strength ~ casting, data = alloys))