This gets the REML or ML estimates and predictions of random effects from the nlme package. function does.
LM_est(x, y, dat, method = "REML")
Design matrix, (p+1)xn, with intercept.
Response vector of nx1.
Data frame
Character string indicating method to use, either "ML" or "REML" (defaults to REML).
Fixed effects esimates.
Standard error for fixed effects.
Variances.
Error.
Raw residuals
Standardized residual
Cluster random error.
Subcluster random error.
Epsilon error.
J. Pinheiro, D. Bates, S. DebRoy, D. Sarkar and R Development Core Team. nlme linear and non- linear mixed effects models. The R Journal, 2011. URL http://CRAN.R-project.org/package=nlme. R package version 3.1-98.