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

ran.group

Randomly mix grouped data and return function results


Description

This function is called by rgr.agree (and potentially other functions). The ran.group function randomly mixes data and applies a function to the pseudo groups. Pseudo group IDs match real group IDs in terms of size.

Usage

ran.group(x,grpid,fun,...)

Arguments

x

A matrix or vector containing data to be randomly sorted.

grpid

A vector containing a group identifier.

fun

A function to be applied to the observations within each random group.

...

Additional arguments to fun.

Value

A vector containing the results of applying the function to each random group.

Author(s)

References

Bliese, P. D., & Halverson, R. R. (2002). Using random group resampling in multilevel research. Leadership Quarterly, 13, 53-68.

See Also

Examples

data(bh1996)
   ran.group(bh1996$HRS,bh1996$GRP,mean)

multilevel

Multilevel Functions

v2.6
GPL (>= 2)
Authors
Paul Bliese
Initial release
2016-07-26

We don't support your browser anymore

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