AGGREGATE.DATA: AGGREGATE.DATA: aggregate data and merge into combined data...

View source: R/AGGREGATE.DATA.R

AGGREGATE.DATAR Documentation

AGGREGATE.DATA: aggregate data and merge into combined data frame

Description

This function augments the aggregate.R base function.

Usage

AGGREGATE.DATA(grpid, x, data, aggr.stat)

Arguments

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

Details

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).

Value

Generates two data files; df.aggr is the aggregate-level file & df.combined is the merged file

Examples

data(lq2002, package = "multilevel")
AGGREGATE.DATA(grpid = "COMPID", x = c("LEAD", "TSIG", "HOSTILE"),
               data = lq2002, aggr.stat = "mean")

james-lebreton/WGA documentation built on Oct. 17, 2022, 4:05 a.m.