Title: | A Generator of Multivariate Non-Normal Random Numbers |
---|---|
Description: | A data generator of multivariate non-normal data in R. It combines two different methods to generate non-normal data, one with user-specified multivariate skewness and kurtosis (more details can be found in the paper: Qu, Liu, & Zhang, 2019 <doi:10.3758/s13428-019-01291-5>), and the other with the given marginal skewness and kurtosis. The latter one is the widely-used Vale and Maurelli's method. It also contains a function to calculate univariate and multivariate (Mardia's Test) skew and kurtosis. |
Authors: | Wen Qu and Zhiyong Zhang |
Maintainer: | Wen Qu <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 1.0.0 |
Built: | 2024-10-31 22:13:11 UTC |
Source: | CRAN |
Univariate and Multivariate skewness and kurtosis checker
mardia(x, na.rm = TRUE)
mardia(x, na.rm = TRUE)
x |
A data matrix |
na.rm |
An indication of the missing data, the default value is True |
Data information: sample size and number of variables. The marginal and multivariate test (Mardia's Test) of skewness and kurtosis.
Multivariate Non-normal Random Number Generator based on Multivariate Measures
mnonr(n, p, ms, mk, Sigma, initial = NULL)
mnonr(n, p, ms, mk, Sigma, initial = NULL)
n |
Sample size |
p |
Number of variables |
ms |
A value of multivariate skewness |
mk |
A value of multivariate kurtosis |
Sigma |
A covariance matrix (In this function, the generated data are standarized. A correlation matrix is equal to its corresponding covariance matrix.) |
initial |
A vector with 3 numbers for initial polynominal coefficients' (b,c,d). The default setting is (0.9,0.4,0). |
A data matrix (multivariate data)
mnonr::mnonr(n=10000,p=2,ms=3,mk=61,Sigma=matrix(c(1,0.5,0.5,1),2,2),initial=NULL)
mnonr::mnonr(n=10000,p=2,ms=3,mk=61,Sigma=matrix(c(1,0.5,0.5,1),2,2),initial=NULL)
Generate Multivariate Non-normal Data using Vale and Maurelli (1983) method. The codes are copied from mvrnonnorm function in the semTools package.
unonr(n, mu, Sigma, skewness = NULL, kurtosis = NULL, empirical = FALSE)
unonr(n, mu, Sigma, skewness = NULL, kurtosis = NULL, empirical = FALSE)
n |
Sample size |
mu |
A mean vector |
Sigma |
A covariance matrix |
skewness |
A skewness vector |
kurtosis |
A kurtosis vector |
empirical |
If TRUE, mu and Sigma specify the empirical not population mean and covariance matrix |
A data matrix (multivariate data)
Vale, C. D. & Maurelli, V. A. (1983) Simulating multivariate nonormal distributions. Psychometrika, 48, 465-471.
unonr(1000, c(1, 2), matrix(c(10, 2, 2, 5), 2, 2), skewness = c(1, 2), kurtosis = c(3, 8))
unonr(1000, c(1, 2), matrix(c(10, 2, 2, 5), 2, 2), skewness = c(1, 2), kurtosis = c(3, 8))