genData: genData

View source: R/simulate.R

genDataR Documentation

genData

Description

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.

Usage

genData(
  N = NULL,
  Sigma = NULL,
  mu = NULL,
  nSets = 1,
  gIdx = NULL,
  modelH0 = NULL,
  simOptions = NULL
)

Arguments

N

sample size.

Sigma

population covariance matrix.

mu

population means.

nSets

number of data sets to generate

gIdx

if not NULL, add gIdx as numeric group index as additional variable to generated data

modelH0

a lavaan model string, only used to determine the number of factors when type = 'RK'

simOptions

additional arguments specifying the data generation routine

Value

Returns the generated data

Examples

## Not run: 
gen <- semPower.genSigma(Phi = .2, loadings = list(rep(.5, 3), rep(.7, 3)))
data <- genData(N = 500, Sigma = gen$Sigma) 

## End(Not run)

semPower documentation built on Sept. 30, 2024, 9:24 a.m.