genData.RK | R Documentation |
Generates random data conforming to a population variance-covariance matrix using the approach by Ruscio & Kaczetow (2008) specifying distributions for the marginals.
genData.RK(
N = NULL,
Sigma = NULL,
nSets = 1,
distributions = NULL,
modelH0 = NULL,
maxIter = 10
)
N |
sample size. |
Sigma |
population covariance matrix. |
nSets |
number of data sets to generate |
distributions |
a list specifying the population distribution and additional arguments in a list either to apply to all variables (e.g. |
modelH0 |
a |
maxIter |
maximum number of iterations, defaults to 10. |
This function is based on the implementation by Ruscio & Kaczetow (2008).
For details, see Ruscio, J., & Kaczetow, W. (2008). Simulating multivariate nonnormal data using an iterative algorithm. Multivariate Behavioral Research, 43, 355-381.
Returns the generated data
## Not run:
distributions <- list(
list('rchisq', list(df = 2)),
list('runif', list(min = 0, max = 1)),
list('rexp', list(rate = 1))
)
data <- genData.ruscio(N = 100, Sigma = diag(3),
distributions = distributions,
modelH0 = 'f =~ x1 + x2 + x3')
distributions <- list(
list('rnorm', list(mean = 0, sd = 10)),
list('runif', list(min = 0, max = 1)),
list('rbeta', list(shape1 = 1, shape2 = 2)),
list('rexp', list(rate = 1)),
list('rpois', list(lambda = 4)),
list('rbinom', list(size = 1, prob = .5))
)
data <- genData.ruscio(N = 100, Sigma = diag(6),
distributions = distributions,
modelH0 = 'f1=~x1+x2+x3\nf2=~x4+x5+x6')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.