Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getGroups.lme

Extract lme Object Groups


Description

The grouping factors corresponding to the linear mixed-effects model represented by object are extracted. If more than one level is indicated in level, the corresponding grouping factors are combined into a data frame; else the selected grouping factor is returned as a vector.

Usage

## S3 method for class 'lme'
getGroups(object, form, level, data, sep)

Arguments

object

an object inheriting from class lme, representing a fitted linear mixed-effects model.

form

this argument is included to make the method function compatible with the generic and is ignored in this method.

level

an optional integer vector giving the level(s) of grouping to be extracted from object. Defaults to the highest or innermost level of grouping.

data

unused

sep

character, the separator to use between group levels when multiple levels are collapsed. The default is '/'.

Value

either a data frame with columns given by the grouping factors indicated in level, or, when a single level is requested, a factor representing the selected grouping factor.

Author(s)

José Pinheiro and Douglas Bates bates@stat.wisc.edu

See Also

Examples

fm1 <- lme(pixel ~ day + day^2, Pixel,
  random = list(Dog = ~day, Side = ~1))
getGroups(fm1, level = 1:2)

nlme

Linear and Nonlinear Mixed Effects Models

v3.1-152
GPL (>= 2) | file LICENCE
Authors
José Pinheiro [aut] (S version), Douglas Bates [aut] (up to 2007), Saikat DebRoy [ctb] (up to 2002), Deepayan Sarkar [ctb] (up to 2005), EISPACK authors [ctb] (src/rs.f), Siem Heisterkamp [ctb] (Author fixed sigma), Bert Van Willigen [ctb] (Programmer fixed sigma), Johannes Ranke [ctb] (varConstProp()), R-core [aut, cre]
Initial release
2021-02-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.