nonnormaldata.sim: Simulate multivariate non-normal data

View source: R/nonnormaldata.sim.R

nonnormaldata.simR Documentation

Simulate multivariate non-normal data

Description

Generates multivariate non-normal data for a specified covariance matrix structure.

Usage

nonnormaldata.sim(Sigma, n = 100, df = rep(2, times = ncol(Sigma)))

Arguments

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)).

Details

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.

Value

Returns a matrix containing the simulated data.

Author(s)

Theo Pepler

References

Pepler, P.T. (2014). The identification and application of common principal components. PhD dissertation in the Department of Statistics and Actuarial Science, Stellenbosch University.

Examples

# 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)

tpepler/cpc documentation built on July 7, 2022, 2:13 a.m.