graph.ran.mean | R Documentation |
Uses random group resampling (RGR) to create a distribution of pseudo group means. Pseudo group means are then contrasted with actual group means to provide a visualization of the group-level properties of the data. It is, in essense, a way of visualizing the ICC1 or an F-Value from an ANOVA model.
graph.ran.mean(x, grpid, nreps, limits, graph=TRUE, bootci=FALSE)
x |
The vector representing the construct of interest. |
grpid |
A vector identifying the groups associated with x. |
nreps |
A number representing the number of random groups to generate. Because groups are created with the exact size characteristics of the actual groups, the total number of pseudo groups created may be calculated as nreps * Number Actual Groups. The value chosen for nreps only affects the smoothness of the pseudo group line – values greater than 25 should provide sufficiently smooth lines. Values of 1000 should be used if the bootci option is TRUE although only 25 are used in the example to reduce computation time. |
limits |
Controls the upper and lower limits of the y-axis on the plot. The default is to set the limits at the 10th and 90th percentiles of the raw data. This option only affects how the data is plotted. |
graph |
Controls whether or not a plot is returned. If graph=FALSE, the program returns a data frame with two columns. The first column contains the sorted means from the actual groups, and the second column contains the sorted means from the pseudo groups. This can be useful for plotting results in other programs. |
bootci |
Determines whether approximate 95 percent confidence interval estimates are calculated and plotted. If bootci is TRUE, the nreps option should be 1000 or more. |
Produces either a plot (graph=TRUE) or a data.frame (graph=FALSE)
Paul Bliese pdbliese@gmail.com
Bliese, P. D., & Halverson, R. R. (2002). Using random group resampling in multilevel research. Leadership Quarterly, 13, 53-68.
ICC1
mix.data
data(bh1996) # with the bootci=TRUE option, nreps should be 1000 or more. The value # of 25 is used in the example to reduce computation time with(bh1996,graph.ran.mean(HRS,GRP,limits=c(8,16),nreps=25, bootci=TRUE)) GRAPH.DAT<-graph.ran.mean(bh1996$HRS,bh1996$GRP,limits=c(8,16),nreps=25, graph=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.