data <- matrix(scan(),ncol=2,byrow=TRUE) 3 1 5 1 6 1 8 2 9.5 2 11 2 10 3 11 3 10.3 3 14 4 16 4 15.7 4 data MixedIntro1 <- data.frame(data) colnames(MixedIntro1) <- c("y","group") rm(data) # the nlme package has the lme function library(nlme) MixedIntro1.lme1 <- lme(y ~ 1, data = MixedIntro1, random = ~ 1 | group) summary(MixedIntro1.lme1) # the fitted object has the parameter estimates and predicted values MixedIntro1.lme1$fitted