SimMultiCorrData0.2.2 package

Simulation of Correlated Data with Multiple Variable Types

calc_final_corr

Calculate Final Correlation Matrix

calc_fisherk

Find Standardized Cumulants of Data based on Fisher's k-statistics

calc_lower_skurt

Find Lower Boundary of Standardized Kurtosis for Polynomial Transforma...

calc_moments

Find Standardized Cumulants of Data by Method of Moments

calc_theory

Find Theoretical Standardized Cumulants for Continuous Distributions

cdf_prob

Calculate Theoretical Cumulative Probability for Continuous Variables

chat_nb

Calculate Upper Frechet-Hoeffding Correlation Bound: Negative Binomial...

chat_pois

Calculate Upper Frechet-Hoeffding Correlation Bound: Poisson - Normal ...

denom_corr_cat

Calculate Denominator Used in Intercorrelations Involving Ordinal Vari...

error_loop

Error Loop to Correct Final Correlation of Simulated Variables

error_vars

Generate Variables for Error Loop

find_constants

Find Power Method Transformation Constants

findintercorr

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

findintercorr_cat_nb

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

findintercorr_cat_pois

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

findintercorr_cont

Calculate Intermediate MVN Correlation for Continuous Variables Genera...

findintercorr_cont_cat

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

findintercorr_cont_nb

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

findintercorr_cont_nb2

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

findintercorr_cont_pois

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

findintercorr_cont_pois2

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

findintercorr_nb

Calculate Intermediate MVN Correlation for Negative Binomial Variables...

findintercorr_pois

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

findintercorr_pois_nb

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

findintercorr2

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

fleish

Fleishman's Third-Order Polynomial Transformation Equations

fleish_Hessian

Fleishman's Third-Order Transformation Hessian Calculation for Lower B...

fleish_skurt_check

Fleishman's Third-Order Transformation Lagrangean Constraints for Lowe...

intercorr_fleish

Fleishman's Third-Order Polynomial Transformation Intermediate Correla...

intercorr_poly

Headrick's Fifth-Order Polynomial Transformation Intermediate Correlat...

max_count_support

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

nonnormvar1

Generation of One Non-Normal Continuous Variable Using the Power Metho...

ordnorm

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

pdf_check

Check Polynomial Transformation Constants for Valid Power Method PDF

plot_cdf

Plot Theoretical Power Method Cumulative Distribution Function for Con...

plot_pdf_ext

Plot Theoretical Power Method Probability Density Function and Target ...

plot_pdf_theory

Plot Theoretical Power Method Probability Density Function and Target ...

plot_sim_cdf

Plot Simulated (Empirical) Cumulative Distribution Function for Contin...

plot_sim_ext

Plot Simulated Data and Target External Data for Continuous or Count V...

plot_sim_pdf_ext

Plot Simulated Probability Density Function and Target PDF of External...

plot_sim_pdf_theory

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

plot_sim_theory

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

poly

Headrick's Fifth-Order Polynomial Transformation Equations

poly_skurt_check

Headrick's Fifth-Order Transformation Lagrangean Constraints for Lower...

power_norm_corr

Calculate Power Method Correlation

rcorrvar

Generation of Correlated Ordinal, Continuous, Poisson, and/or Negative...

rcorrvar2

Generation of Correlated Ordinal, Continuous, Poisson, and/or Negative...

separate_rho

Separate Target Correlation Matrix by Variable Type

sim_cdf_prob

Calculate Simulated (Empirical) Cumulative Probability

SimMultiCorrData

Simulation of Correlated Data with Multiple Variable Types

stats_pdf

Calculate Theoretical Statistics for a Valid Power Method PDF

valid_corr

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

valid_corr2

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

var_cat

Calculate Variance of Binary or Ordinal Variable

Generate continuous (normal or non-normal), binary, ordinal, and count (Poisson or Negative Binomial) variables with a specified correlation matrix. It can also produce a single continuous variable. This package can be used to simulate data sets that mimic real-world situations (i.e. clinical or genetic data sets, plasmodes). All variables are generated from standard normal variables with an imposed intermediate correlation matrix. Continuous variables are simulated by specifying mean, variance, skewness, standardized kurtosis, and fifth and sixth standardized cumulants using either Fleishman's third-order (<DOI:10.1007/BF02293811>) or Headrick's fifth-order (<DOI:10.1016/S0167-9473(02)00072-5>) polynomial transformation. Binary and ordinal variables are simulated using a modification of the ordsample() function from 'GenOrd'. Count variables are simulated using the inverse cdf method. There are two simulation pathways which differ primarily according to the calculation of the intermediate correlation matrix. In Correlation Method 1, the intercorrelations involving count variables are determined using a simulation based, logarithmic correlation correction (adapting Yahav and Shmueli's 2012 method, <DOI:10.1002/asmb.901>). In Correlation Method 2, the count variables are treated as ordinal (adapting Barbiero and Ferrari's 2015 modification of GenOrd, <DOI:10.1002/asmb.2072>). There is an optional error loop that corrects the final correlation matrix to be within a user-specified precision value of the target matrix. The package also includes functions to calculate standardized cumulants for theoretical distributions or from real data sets, check if a target correlation matrix is within the possible correlation bounds (given the distributions of the simulated variables), summarize results (numerically or graphically), to verify valid power method pdfs, and to calculate lower standardized kurtosis bounds.