createDataCRD {MBESS}R Documentation

Create the cluster-randomized design data with two conditions

Description

Create the cluster-randomized design data with two conditions. If a covaraite is specified, the covariate will not correlate with the grouping variable.

Usage

createDataCRD(nclus, ntreatclus, nindiv, iccy, es, estype = 1, totalvar=1, 
	covariate=FALSE, iccz=NULL, r2within=NULL, r2between=NULL, totalvarz = 1)
createDataCRDWide(nclus, ntreatclus, nindiv, iccy, es, estype = 1, totalvar=1, 
	covariate=FALSE, iccz=NULL, r2within=NULL, r2between=NULL, totalvarz = 1)

Arguments

nclus

The number of clusters

ntreatclus

The number of clusters in the treatment condition

nindiv

The number of individuals within each group (cluster size)

iccy

The intraclass correlation of the dependent variable

es

The amount of effect size

estype

The type of effect size. There are only three possible options: 0 = the effect size using total standard deviation, 1 = the effect size using the individual-level standard deviation (level 1), 2 = the effect size using the cluster-level standard deviation (level 2)

totalvar

The amount of total variance in the dependent variable

covariate

If TRUE, a single covariate is included into the model. If FALSE, the no-covariate model is used.

iccz

The intraclass correlation of the covariate (used when covariate = TRUE). If iccz = 0, the within-level covariate will be only created. If iccz = 1, the between-level covariate will be only created.

r2within

The proportion of variance explained in the within level (used when covariate = TRUE)

r2between

The proportion of variance explained in the between level (used when covariate = TRUE)

totalvarz

The total variance of the covariate (used when covariate = TRUE)

Value

A dataset in the long format if the createDataCRD function is used and in the wide format if the createDataCRDWide function is used.

Author(s)

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

Examples

## Not run: 
dat <- createDataCRD(100, 50, 4, iccy=0.25, es=0.5)
datWide <- createDataCRDWide(100, 50, 5, iccy=0.25, es=0.5, estype = 0, totalvar=1, 
	covariate=TRUE, iccz=0.25, r2within=0.5, r2between=0.5, totalvarz = 1)

## End(Not run)

[Package MBESS version 3.3.3 Index]