View source: R/AGGREGATE.DATA.R
AGGREGATE.DATA | R Documentation |
This function augments the aggregate.R base function.
AGGREGATE.DATA(grpid, x, data, aggr.stat)
grpid |
Name of the grouping/clustering variable |
x |
Name(s) of the item(s)/variable(s) to be aggregated |
data |
Name of data frame containing group and vars |
aggr.stat |
Name of the function used to aggregate data |
The input consists of a data frame, and the names of the grouping variable and item. The output consists of a data frame containing the group names, the variance within each group, and estimates of rwg based on multiple null response distributions (see LeBreton and Senter, 2008).
Generates two data files; df.aggr is the aggregate-level file & df.combined is the merged file
data(lq2002, package = "multilevel") AGGREGATE.DATA(grpid = "COMPID", x = c("LEAD", "TSIG", "HOSTILE"), data = lq2002, aggr.stat = "mean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.