| createDataCRD {MBESS} | R Documentation |
Create the cluster-randomized design data with two conditions. If a covaraite is specified, the covariate will not correlate with the grouping variable.
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)
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 |
iccz |
The intraclass correlation of the covariate (used when |
r2within |
The proportion of variance explained in the within level (used when |
r2between |
The proportion of variance explained in the between level (used when |
totalvarz |
The total variance of the covariate (used when |
A dataset in the long format if the createDataCRD function is used and in the wide format if the createDataCRDWide function is used.
Sunthud Pornprasertmanit (University of Kansas; psunthud@ku.edu)
## 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)