SimCorrMix0.1.1 package

Simulation of Correlated Data with Multiple Variable Types Including Continuous and Count Mixture Distributions

calc_mixmoments

Find Standardized Cumulants of a Continuous Mixture Distribution by Me...

contmixvar1

Generation of One Continuous Variable with a Mixture Distribution Usin...

corr_error

Error Loop to Correct Final Correlation of Simulated Variables

corrvar

Generation of Correlated Ordinal, Continuous (mixture and non-mixture)...

corrvar2

Generation of Correlated Ordinal, Continuous (mixture and non-mixture)...

intercorr

Calculate Intermediate MVN Correlation for Ordinal, Continuous, Poisso...

intercorr_cat_nb

Calculate Intermediate MVN Correlation for Ordinal - Negative Binomial...

intercorr_cat_pois

Calculate Intermediate MVN Correlation for Ordinal - Poisson Variables...

intercorr_cont

Calculate Intermediate MVN Correlation for Continuous Variables Genera...

intercorr_cont_nb

Calculate Intermediate MVN Correlation for Continuous - Negative Binom...

intercorr_cont_nb2

Calculate Intermediate MVN Correlation for Continuous - Negative Binom...

intercorr_cont_pois

Calculate Intermediate MVN Correlation for Continuous - Poisson Variab...

intercorr_cont_pois2

Calculate Intermediate MVN Correlation for Continuous - Poisson Variab...

intercorr_nb

Calculate Intermediate MVN Correlation for Negative Binomial Variables...

intercorr_pois

Calculate Intermediate MVN Correlation for Poisson Variables: Correlat...

intercorr_pois_nb

Calculate Intermediate MVN Correlation for Poisson - Negative Binomial...

intercorr2

Calculate Intermediate MVN Correlation for Ordinal, Continuous, Poisso...

maxcount_support

Calculate Maximum Support Value for Count Variables: Correlation Metho...

norm_ord

Calculate Correlations of Ordinal Variables Obtained from Discretizing...

ord_norm

Calculate Intermediate MVN Correlation to Generate Variables Treated a...

plot_simpdf_theory

Plot Simulated Probability Density Function and Target PDF by Distribu...

plot_simtheory

Plot Simulated Data and Target Distribution Data by Name or Function f...

rho_M1M2

Approximate Correlation between Two Continuous Mixture Variables M1 an...

rho_M1Y

Approximate Correlation between Continuous Mixture Variable M1 and Ran...

SimCorrMix

Simulation of Correlated Data with Multiple Variable Types Including C...

summary_var

Summary of Simulated Variables

validcorr

Determine Correlation Bounds for Ordinal, Continuous, Poisson, and/or ...

validcorr2

Determine Correlation Bounds for Ordinal, Continuous, Poisson, and/or ...

validpar

Parameter Check for Simulation or Correlation Validation Functions

Generate continuous (normal, non-normal, or mixture distributions), binary, ordinal, and count (regular or zero-inflated, Poisson or Negative Binomial) variables with a specified correlation matrix, or one continuous variable with a mixture distribution. This package can be used to simulate data sets that mimic real-world clinical or genetic data sets (i.e., plasmodes, as in Vaughan et al., 2009 <DOI:10.1016/j.csda.2008.02.032>). The methods extend those found in the 'SimMultiCorrData' R package. Standard normal variables with an imposed intermediate correlation matrix are transformed to generate the desired distributions. Continuous variables are simulated using either Fleishman (1978)'s third order <DOI:10.1007/BF02293811> or Headrick (2002)'s fifth order <DOI:10.1016/S0167-9473(02)00072-5> polynomial transformation method (the power method transformation, PMT). Non-mixture distributions require the user to specify mean, variance, skewness, standardized kurtosis, and standardized fifth and sixth cumulants. Mixture distributions require these inputs for the component distributions plus the mixing probabilities. Simulation occurs at the component level for continuous mixture distributions. The target correlation matrix is specified in terms of correlations with components of continuous mixture variables. These components are transformed into the desired mixture variables using random multinomial variables based on the mixing probabilities. However, the package provides functions to approximate expected correlations with continuous mixture variables given target correlations with the components. Binary and ordinal variables are simulated using a modification of ordsample() in package 'GenOrd'. Count variables are simulated using the inverse CDF method. There are two simulation pathways which calculate intermediate correlations involving count variables differently. Correlation Method 1 adapts Yahav and Shmueli's 2012 method <DOI:10.1002/asmb.901> and performs best with large count variable means and positive correlations or small means and negative correlations. Correlation Method 2 adapts Barbiero and Ferrari's 2015 modification of the 'GenOrd' package <DOI:10.1002/asmb.2072> and performs best under the opposite scenarios. The optional error loop may be used to improve the accuracy of the final correlation matrix. The package also contains functions to calculate the standardized cumulants of continuous mixture distributions, check parameter inputs, calculate feasible correlation boundaries, and summarize and plot simulated variables.