Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nnig_sim

Simulation of Multivariate Linearly Related Non-Normal Variables


Description

Simulates multivariate linearly related non-normally distributed variables (Foldnes & Olsson, 2016). For marginal distributions, skewness and (excess) kurtosis values are provided and the values are simulated according to the Fleishman power transformation (Fleishman, 1978; see fleishman_sim).

The function nnig_sim simulates data from a multivariate random variable \bold{Y} which is related to a number of independent variables \bold{X} (independent generators; Foldnes & Olsson, 2016) which are Fleishman power normally distributed. In detail, it holds that \bold{Y}=\bold{μ} + \bold{A} \bold{X} where the covariance matrix \bold{Σ} is decomposed according to a Cholesky decomposition \bold{Σ}=\bold{A} \bold{A}^T.

Usage

# determine coefficients
nnig_coef(mean=NULL, Sigma, skew, kurt)

# simulate values
nnig_sim(N, coef)

Arguments

mean

Vector of means. The default is a vector containing zero means.

Sigma

Covariance matrix

skew

Vector of skewness values

kurt

Vector of (excess) kurtosis values

N

Number of cases

coef

List of parameters generated by nnig_coef

Value

A list of parameter values (nnig_coef) or a data frame with simulated values (nnig_sim).

References

Fleishman, A. I. (1978). A method for simulating non-normal distributions. Psychometrika, 43(4), 521-532. doi: 10.1007/BF02293811

Foldnes, N., & Olsson, U. H. (2016). A simple simulation technique for nonnormal data with prespecified skewness, kurtosis, and covariance matrix. Multivariate Behavioral Research, 51(2-3), 207-219. doi: 10.1080/00273171.2015.1133274

Vale, D. C., & Maurelli, V. A. (1983). Simulating multivariate nonnormal distributions. Psychometrika, 48(3), 465-471. doi: 10.1007/BF02293687

See Also

See fungible::monte1 for simulating multivariate linearly related non-normally distributed variables generated by the method of Vale and Morelli (1983). See also the MultiVarMI::MVNcorr function in the MultiVarMI package and the SimMultiCorrData package.

The MultiVarMI also includes an imputation function MultiVarMI::MI for non-normally distributed variables.

Examples

#############################################################################
# EXAMPLE 1: Simulating data with nnig_sim function
#############################################################################

#* define input parameters
Sigma <- matrix( c(1,.5, .2,
                  .5, 1,.7,
                  .2, .7, 1), 3, 3 )
skew <- c(0,1,1)
kurt <- c(1,3,3)

#* determine coefficients
coeff <- miceadds::nnig_coef( Sigma=Sigma, skew=skew, kurt=kurt )
print(coeff)

#* simulate data
set.seed(2018)
Y <- miceadds::nnig_sim( N=2000, coef=coeff)

## Not run: 
#* check descriptive statistics
apply(Y, 2, TAM::weighted_skewness )
apply(Y, 2, TAM::weighted_kurtosis )

## End(Not run)

miceadds

Some Additional Multiple Imputation Functions, Especially for 'mice'

v3.11-6
GPL (>= 2)
Authors
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>), Simon Grund [aut] (<https://orcid.org/0000-0002-1290-8986>), Thorsten Henke [ctb]
Initial release
2021-01-21 11:48:47

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.