gendat_vm: Generate Nonnormal Data Using the Vale and Maurelli (1983)...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/gendat.R

Description

Generates nonnormal data using the Vale and Maurelli (1983) approach from a correlation matrix \dot{Σ} with predefined skewness and kurtosis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gendat_vm(
  n,
  Sigma_dot,
  skew,
  kurt,
  seed = sample(1:.Machine$integer.max, size = 1),
  rescale = FALSE,
  mu,
  sigma2
)

Arguments

n

Sample size.

Sigma_dot

p \times p correlation matrix (\dot{Σ}).

skew

Skewness vector. If a single value is given, the function assumes that the p elements in the vector will have the same skewness.

kurt

Kurtosis vector. If a single value is given, the function assumes that the p elements in the vector will have the same kurtosis.

seed

Random seed for reproducibility.

rescale

Logical. Rescale the data using means mu (μ) and variances sigma2 (σ^2) provided. Note that the actual means and variances that the final data set will have are drawn randomly from a normal distrbution using mu and sigma2 as parameters.

mu

Vector of means corresponding to each element of Sigma_dot (\dot{Σ}) that will be used as population means when rescale is TRUE. If a single value is given, the function assumes that the p elements in the vector will have the same mu.

sigma2

Vector of variances corresponding to each element of Sigma_dot (\dot{Σ}) that will be used as population variances when rescale is TRUE. If a single value is given, the function assumes that the p elements in the vector will have the same sigma2.

Value

Returns an n \times p nonnormal data matrix using the Vale and Maurelli (1983) approach from a p \times p correlation matrix provided and predefined skewness and kurtosis.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Fleishman, A. I (1978). A method for simulating non-normal distributions. Psychometrika, 43, 521–532.

Vale, D. C., & Maurelli, V. A. (1983). Simulating multivariate nonnormal distributions. Psychometrika, 48, 465–471.

See Also

Other data generating functions: gendat_linreg_X(), gendat_linreg_y(), gendat_linreg(), gendat_mvn_a(), gendat_mvn_fe(), gendat_mvn(), gendat()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
Sigma_dot <- matrix(
  data = .60,
  ncol = 4,
  nrow = 4
)
diag(Sigma_dot) <- 1
n <- 100
skew <- 1.75
kurt <- 3.75
mu <- 100
sigma2 <- 225
data <- gendat_vm(
  n = n,
  Sigma_dot = Sigma_dot,
  skew = skew,
  kurt = kurt,
  mu = mu,
  sigma2 = sigma2
)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.