gsummary {nlme} | R Documentation |
Summarize by Groups
Description
Provide a summary of the variables in a data frame by groups of rows.
This is most useful with a groupedData
object to examine the
variables by group.
Usage
gsummary(object, FUN, omitGroupingFactor, form, level,
groups, invariantsOnly, ...)
Arguments
object |
an object to be summarized - usually a |
FUN |
an optional summary function or a list of summary functions
to be applied to each variable in the frame. The function or
functions are applied only to variables in |
omitGroupingFactor |
an optional logical value. When |
form |
an optional one-sided formula that defines the groups.
When this formula is given, the right-hand side is evaluated in
|
level |
an optional positive integer giving the level of grouping to be used in an object with multiple nested grouping levels. Defaults to the highest or innermost level of grouping. |
groups |
an optional factor that will be used to split the
rows into groups. Defaults to |
invariantsOnly |
an optional logical value. When |
... |
optional additional arguments to the summary functions
that are invoked on the variables by group. Often it is helpful to
specify |
Value
A data.frame
with one row for each level of the grouping
factor. The number of columns is at most the number of columns in
object
.
Author(s)
José Pinheiro and Douglas Bates bates@stat.wisc.edu
References
Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer.
See Also
summary
, groupedData
,
getGroups
Examples
gsummary(Orthodont) # default summary by Subject
## gsummary with invariantsOnly = TRUE and omitGroupingFactor = TRUE
## determines whether there are covariates like Sex that are invariant
## within the repeated observations on the same Subject.
gsummary(Orthodont, invariantsOnly = TRUE, omitGroupingFactor = TRUE)