groupedData {nlme}  R Documentation 
An object of the groupedData
class is constructed from the
formula
and data
by attaching the formula
as an
attribute of the data, along with any of outer
, inner
,
labels
, and units
that are given. If
order.groups
is TRUE
the grouping factor is converted to
an ordered factor with the ordering determined by
FUN
. Depending on the number of grouping levels and the type of
primary covariate, the returned object will be of one of three
classes: nfnGroupedData
 numeric covariate, single level of
nesting; nffGroupedData
 factor covariate, single level of
nesting; and nmGroupedData
 multiple levels of
nesting. Several modeling and plotting functions can use the formula
stored with a groupedData
object to construct default plots and
models.
groupedData(formula, data, order.groups, FUN, outer, inner, labels, units) ## S3 method for class 'groupedData' update(object, formula, data, order.groups, FUN, outer, inner, labels, units, ...)
object 
an object inheriting from class 
formula 
a formula of the form 
data 
a data frame in which the expressions in 
order.groups 
an optional logical value, or list of logical
values, indicating if the grouping factors should be converted to
ordered factors according to the function 
FUN 
an optional summary function that will be applied to the
values of the response for each level of the grouping factor, when

outer 
an optional onesided formula, or list of onesided
formulas, indicating covariates that are outer to the grouping
factor(s). If multiple levels of grouping are present,
this argument can be either a single onesided formula, or a list of
onesided formulas. If no names are assigned to the list elements,
they are assumed in the same order as the group levels (outermost to
innermost grouping). An outer covariate is invariant within the sets
of rows defined by the grouping factor. Ordering of the groups is
done in such a way as to preserve adjacency of groups with the same
value of the outer variables. When plotting a groupedData object,
the argument 
inner 
an optional onesided formula, or list of onesided
formulas, indicating covariates that are inner to the grouping
factor(s). If multiple levels of grouping are present,
this argument can be either a single onesided formula, or a list of
onesided formulas. If no names are assigned to the list elements,
they are assumed in the same order as the group levels (outermost to
innermost grouping). An inner covariate can change
within the sets of rows defined by the grouping factor. An inner
formula can be used to associate points in a plot of a groupedData
object. Defaults to 
labels 
an optional list of character strings giving labels for
the response and the primary covariate. The label for the primary
covariate is named 
units 
an optional list of character strings giving the units for
the response and the primary covariate. The units string for the
primary covariate is named 
... 
some methods for this generic require additional arguments. None are used in this method. 
an object of one of the classes nfnGroupedData
,
nffGroupedData
, or nmGroupedData
, and also inheriting
from classes groupedData
and data.frame
.
Douglas Bates and JosÃ© Pinheiro
Bates, D.M. and Pinheiro, J.C. (1997), "Software Design for Longitudinal Data", in "Modelling Longitudinal and Spatially Correlated Data: Methods, Applications and Future Directions", T.G. Gregoire (ed.), SpringerVerlag, New York.
Pinheiro, J.C. and Bates, D.M. (1997) "Future Directions in MixedEffects Software: Design of NLME 3.0" available at http://nlme.stat.wisc.edu/
Pinheiro, J.C., and Bates, D.M. (2000) "MixedEffects Models in S and SPLUS", Springer.
formula
, gapply
,
gsummary
,
lme
,
plot.nffGroupedData
,
plot.nfnGroupedData
,
plot.nmGroupedData
,
reStruct
Orth.new < # create a new copy of the groupedData object groupedData( distance ~ age  Subject, data = as.data.frame( Orthodont ), FUN = mean, outer = ~ Sex, labels = list( x = "Age", y = "Distance from pituitary to pterygomaxillary fissure" ), units = list( x = "(yr)", y = "(mm)") ) plot( Orth.new ) # trellis plot by Subject formula( Orth.new ) # extractor for the formula gsummary( Orth.new ) # apply summary by Subject fm1 < lme( Orth.new ) # fixed and groups formulae extracted from object Orthodont2 < update(Orthodont, FUN = mean)