wideFormat {MBESS}R Documentation

Transform nested data from long format into wide format

Description

Transform nested data from long format into wide format to run multilevel model in structural equation modeling framework (Bauer, 2003).

Usage

wideFormat(data, betweencol, withincol, idcol)

Arguments

data

A long-format dataset

betweencol

The columns of the between-level variables

withincol

The columns of the within-level variables

idcol

The variable specifying cluster ID

Value

A dataset in wide format

Author(s)

Sunthud Pornprasertmanit (University of Kansas; psunthud@ku.edu)

References

Bauer, D. J. (2003). Estimating multilevel linear models as structural equation models. Journal of Educational and Behavioral Statistics, 28, 135-167.

Examples

## Not run: 
dat <- createDataCRD(100, 50, 4, iccy=0.25, es=0.5)
datwide <- wideFormat(dat, 3, 2, 1)

## End(Not run)

[Package MBESS version 3.3.3 Index]