R: Engine (generation) function for the PoisBinOrdNonNor package
genPBONN
R Documentation
Engine (generation) function for the PoisBinOrdNonNor package
Description
This function generates a chosen number of Poisson, binary, ordinal, and continuous (via Fleishman
polynomials) random variables, with specified correlations and marginal properties.
The correlation matrix and the generated data follow the order of Poisson, binary, ordinal and continuous.
The number of Poisson random variables desired. Defaults to 0.
no.bin
The number of binary random variables desired. Defaults to 0.
no.ord
The number of ordinal random variables desired. Defaults to 0.
no.nonn
The number of continuous random variables desired, created using Fleishman polynomials. Defaults to 0.
pois.list
A list of the lambda values, which must be greater than 0. Length will be equal to no.pois, or an error will be thrown. Defaults to an empty list.
bin.list
A list of vectors containing the probabilities for each variable. Each vector should have 2 entries between 0 and 1 inclusive, and sum to 1. Length must be equal to no.bin. Defaults to an empty list.
ord.list
A list of vectors containing the probabilities for each variable. Each vector should have entries between 0 and 1 inclusive, and sum to 1. Length must be equal to no.ord. Defaults to an empty list.
is.ord.list.cum
Flag for whether the ordinal list supplied contains cumulative probabilities. Defaults to FALSE.
nonn.list
A list of vectors containing the first four moments of each variable, in order. If only two parameters are supplied, they will be assumed to be skew and excess kurtosis, with mean = 0 and variance = 1. If only three parameters are supplied, they will be assumed to be variance, skew and excess kurtosis, with mean = 0. If less than two parameters or more than four parameters are supplied for any variable, an error will be raised. Variance must be positive, and excess kurtosis must be greater than or equal to skew^2-2. Length must be equal to no.nonn. Defaults to an empty list.
Details
After transformation and checking of parameters, a n by (no.pois+no.bin+no.ord+no.nonn) matrix of standard normal random data is generated, using cmat.star as the correlation matrix.
Then for each variable, the appropriate transformation is applied to each column of the data generated.
Value
A n by (no.pois+no.bin+no.ord+no.nonn) matrix. Each column corresponds to a variable, and each row is one random sample.
References
Amatya, A. & Demirtas, H. (2015) Simultaneous generation of multivariate mixed
data with Poisson and normal marginals. Journal of Statistical Computation and Simulation85:15, 3129–3139.
Demirtas, H. & Hedeker, D. (2011) A practical way for computing approximate
lower and upper correlation bounds. American Statistician65:2, 104–109.
Demirtas, H., Hedeker, D. & Mermelstein, R. J. (2012) Simulation of massive public
health data by power polynomials. Statistics in Medicine31:27, 3337–3346.
Demirtas, H. (2014). Joint generation of binary and nonnormal continuous data.
Journal of Biometrics and Biostatistics5:3:1000199, 1–9.
Demirtas, H. & Hedeker, D. (2016). Computing the point-biserial correlation under
any underlying continuous distribution. Forthcoming in Communications in Statistics–
Simulation and Computation.