View source: R/nonnormaldata.sim.R
nonnormaldata.sim | R Documentation |
Generates multivariate non-normal data for a specified covariance matrix structure.
nonnormaldata.sim(Sigma, n = 100, df = rep(2, times = ncol(Sigma)))
Sigma |
Covariance matrix of the population from which to simulate the data. |
n |
Sample size. |
df |
Vector of chi square degrees of freedom, to control skewness of the variables (skew = sqrt(8/df)). |
Simulates data from a multivariate distribution of which the variables are marginally distributed chi-squared with two degrees of freedom (default). This function can be useful in simulation studies when the purpose is to determine the effect of non-normality in the population on some statistical method, given a specific population covariance structure.
Returns a matrix containing the simulated data.
Theo Pepler
Pepler, P.T. (2014). The identification and application of common principal components. PhD dissertation in the Department of Statistics and Actuarial Science, Stellenbosch University.
# Simulate 30 observations from a multivariate non-normally distributed # population with the same covariance structure as the versicolor group # in the Iris data set data(iris) versicolor <- iris[51:100, 1:4] nonnormaldata.sim(Sigma = cov(versicolor), n = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.