Rev 6561 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File nlme/man/ranef.lme.Rd% Part of the nlme package for R% Distributed under GPL 2 or later: see nlme/LICENCE.note\name{ranef.lme}\title{Extract lme Random Effects}\usage{\method{ranef}{lme}(object, augFrame, level, data, which, FUN,standard, omitGroupingFactor, subset, \dots)}\alias{ranef.lme}\alias{random.effects.lme}\alias{print.ranef.lme}\arguments{\item{object}{an object inheriting from class \code{"\link{lme}"}, representinga fitted linear mixed-effects model.}\item{augFrame}{an optional logical value. If \code{TRUE}, the returneddata frame is augmented with variables defined in \code{data}; else,if \code{FALSE}, only the coefficients are returned. Defaults to\code{FALSE}.}\item{level}{an optional vector of positive integers giving the levelsof grouping to be used in extracting the random effects from anobject with multiple nested grouping levels. Defaults to all levelsof grouping.}\item{data}{an optional data frame with the variables to be used foraugmenting the returned data frame when \code{augFrame =TRUE}. Defaults to the data frame used to fit \code{object}.}\item{which}{an optional positive integer vector specifying whichcolumns of \code{data} should be used in the augmentation of thereturned data frame. Defaults to all columns in \code{data}.}\item{FUN}{an optional summary function or a list of summary functionsto be applied to group-varying variables, when collapsing \code{data}by groups. Group-invariant variables are always summarized by theunique value that they assume within that group. If \code{FUN} is asingle function it will be applied to each non-invariant variable bygroup to produce the summary for that variable. If \code{FUN} is alist of functions, the names in the list should designate classes ofvariables in the frame such as \code{ordered}, \code{factor}, or\code{numeric}. The indicated function will be applied to anygroup-varying variables of that class. The default functions to beused are \code{mean} for numeric factors, and \code{Mode} for both\code{factor} and \code{ordered}. The \code{Mode} function, definedinternally in \code{gsummary}, returns the modal or most popularvalue of the variable. It is different from the \code{mode} functionthat returns the S-language mode of the variable.}\item{standard}{an optional logical value indicating whether theestimated random effects should be "standardized" (i.e. divided bythe estimate of the standard deviation of that group of randomeffects). Defaults to \code{FALSE}.}\item{omitGroupingFactor}{an optional logical value. When \code{TRUE}the grouping factor itself will be omitted from the group-wisesummary of \code{data} but the levels of the grouping factor willcontinue to be used as the row names for the returned data frame.Defaults to \code{FALSE}.}\item{subset}{an optional expression indicating for which rows therandom effects should be extracted.}\item{\dots}{some methods for this generic require additionalarguments. None are used in this method.}}\description{The estimated random effects at level \eqn{i} are represented as adata frame with rows given by the different groups at that level andcolumns given by the random effects. If a single level ofgrouping is specified, the returned object is a data frame; else, thereturned object is a list of such data frames. Optionally, thereturned data frame(s) may be augmented with covariates summarizedover groups.}\value{a data frame, or list of data frames, with the estimatedrandom effects at the grouping level(s) specified in \code{level} and,optionally, other covariates summarized over groups. The returnedobject inherits from classes \code{random.effects.lme} and\code{data.frame}.}\references{Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Modelsin S and S-PLUS", Springer, esp. pp. 100, 461.}\author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}}\seealso{\code{\link{coef.lme}},\code{\link{gsummary}},\code{\link{lme}}, %\code{\link{fixed.effects.lme}},\code{\link{plot.ranef.lme}},\code{\link{random.effects}}}\examples{fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject)ranef(fm1)random.effects(fm1) # same as aboverandom.effects(fm1, augFrame = TRUE)}\keyword{models}