powered by
Generates random data from population variance-covariance matrix and population means, either from a multivariate normal distribution, or using one of various approaches to generate non-normal data.
genData( N = NULL, Sigma = NULL, mu = NULL, nSets = 1, gIdx = NULL, modelH0 = NULL, simOptions = NULL )
Returns the generated data
sample size.
population covariance matrix.
population means.
number of data sets to generate
if not NULL, add gIdx as numeric group index as additional variable to generated data
NULL
a lavaan model string, only used to determine the number of factors when type = 'RK'
lavaan
type = 'RK'
additional arguments specifying the data generation routine
if (FALSE) { gen <- semPower.genSigma(Phi = .2, loadings = list(rep(.5, 3), rep(.7, 3))) data <- genData(N = 500, Sigma = gen$Sigma) }
Run the code above in your browser using DataLab