Package: SimMultiCorrData 0.2.2

SimMultiCorrData: Simulation of Correlated Data with Multiple Variable Types

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.

Authors:Allison Cynthia Fialkowski

SimMultiCorrData_0.2.2.tar.gz
SimMultiCorrData_0.2.2.zip(r-4.5)SimMultiCorrData_0.2.2.zip(r-4.4)SimMultiCorrData_0.2.2.zip(r-4.3)
SimMultiCorrData_0.2.2.tgz(r-4.4-any)SimMultiCorrData_0.2.2.tgz(r-4.3-any)
SimMultiCorrData_0.2.2.tar.gz(r-4.5-noble)SimMultiCorrData_0.2.2.tar.gz(r-4.4-noble)
SimMultiCorrData_0.2.2.tgz(r-4.4-emscripten)SimMultiCorrData_0.2.2.tgz(r-4.3-emscripten)
SimMultiCorrData.pdf |SimMultiCorrData.html
SimMultiCorrData/json (API)
NEWS

# Install 'SimMultiCorrData' in R:
install.packages('SimMultiCorrData', repos = c('https://afialkowski.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/afialkowski/simmulticorrdata/issues

Datasets:
  • H_params - Parameters for Examples of Constants Calculated by Headrick's Fifth-Order Polynomial Transformation
  • Headrick.dist - Examples of Constants Calculated by Headrick's Fifth-Order Polynomial Transformation

On CRAN:

7.53 score 11 stars 6 packages 43 scripts 554 downloads 53 exports 39 dependencies

Last updated 6 years agofrom:89bd4e5a3f. Checks:OK: 3 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 27 2024
R-4.5-winOKOct 27 2024
R-4.5-linuxOKOct 27 2024
R-4.4-winNOTEOct 27 2024
R-4.4-macNOTEOct 27 2024
R-4.3-winNOTEOct 27 2024
R-4.3-macNOTEOct 27 2024

Exports:calc_final_corrcalc_fisherkcalc_lower_skurtcalc_momentscalc_theorycdf_probchat_nbchat_poisdenom_corr_caterror_looperror_varsfind_constantsfindintercorrfindintercorr_cat_nbfindintercorr_cat_poisfindintercorr_contfindintercorr_cont_catfindintercorr_cont_nbfindintercorr_cont_nb2findintercorr_cont_poisfindintercorr_cont_pois2findintercorr_nbfindintercorr_poisfindintercorr_pois_nbfindintercorr2fleishfleish_Hessianfleish_skurt_checkintercorr_fleishintercorr_polymax_count_supportnonnormvar1ordnormpdf_checkplot_cdfplot_pdf_extplot_pdf_theoryplot_sim_cdfplot_sim_extplot_sim_pdf_extplot_sim_pdf_theoryplot_sim_theorypolypoly_skurt_checkpower_norm_corrrcorrvarrcorrvar2separate_rhosim_cdf_probstats_pdfvalid_corrvalid_corr2var_cat

Dependencies:assertthatBBclicolorspacefansifarverGenOrdggplot2glueGPArotationgtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmnormtmunsellmvtnormnleqslvnlmepillarpkgconfigpsychquadprogR6RColorBrewerrlangscalestibbletriangleutf8vctrsVGAMviridisLitewithr

Benefits of SimMultiCorrData and Comparison to Other Packages

Rendered frombenefits.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-10-25
Started: 2017-06-22

Comparison of Correlation Method 1 and Correlation Method 2

Rendered frommethod_comp.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-10-25
Started: 2017-06-22

Comparison of Simulated Distribution to Theoretical Distribution or Empirical Data

Rendered fromdist_comp.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-10-25
Started: 2017-06-22

Functions by Topic

Rendered fromfunctions.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-10-25
Started: 2017-06-22

Overall Workflow for Data Simulation

Rendered fromworkflow.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-10-25
Started: 2017-06-22

Overview of Error Loop

Rendered fromerrorloop.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-11-05
Started: 2017-06-22

Using the Sixth Cumulant Correction to Find Valid Power Method Pdfs

Rendered fromsixth_validpdf.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-10-25
Started: 2017-06-22

Variable Types

Rendered fromvariable_types.Rmdusingknitr::rmarkdownon Oct 27 2024.

Last update: 2017-10-25
Started: 2017-06-22

Readme and manuals

Help Manual

Help pageTopics
Calculate Final Correlation Matrixcalc_final_corr
Find Standardized Cumulants of Data based on Fisher's k-statisticscalc_fisherk
Find Lower Boundary of Standardized Kurtosis for Polynomial Transformationcalc_lower_skurt
Find Standardized Cumulants of Data by Method of Momentscalc_moments
Find Theoretical Standardized Cumulants for Continuous Distributionscalc_theory
Calculate Theoretical Cumulative Probability for Continuous Variablescdf_prob
Calculate Upper Frechet-Hoeffding Correlation Bound: Negative Binomial - Normal Variableschat_nb
Calculate Upper Frechet-Hoeffding Correlation Bound: Poisson - Normal Variableschat_pois
Calculate Denominator Used in Intercorrelations Involving Ordinal Variablesdenom_corr_cat
Error Loop to Correct Final Correlation of Simulated Variableserror_loop
Generate Variables for Error Looperror_vars
Find Power Method Transformation Constantsfind_constants
Calculate Intermediate MVN Correlation for Ordinal, Continuous, Poisson, or Negative Binomial Variables: Correlation Method 1findintercorr
Calculate Intermediate MVN Correlation for Ordinal - Negative Binomial Variables: Correlation Method 1findintercorr_cat_nb
Calculate Intermediate MVN Correlation for Ordinal - Poisson Variables: Correlation Method 1findintercorr_cat_pois
Calculate Intermediate MVN Correlation for Continuous Variables Generated by Polynomial Transformationfindintercorr_cont
Calculate Intermediate MVN Correlation for Continuous - Ordinal Variablesfindintercorr_cont_cat
Calculate Intermediate MVN Correlation for Continuous - Negative Binomial Variables: Correlation Method 1findintercorr_cont_nb
Calculate Intermediate MVN Correlation for Continuous - Negative Binomial Variables: Correlation Method 2findintercorr_cont_nb2
Calculate Intermediate MVN Correlation for Continuous - Poisson Variables: Correlation Method 1findintercorr_cont_pois
Calculate Intermediate MVN Correlation for Continuous - Poisson Variables: Correlation Method 2findintercorr_cont_pois2
Calculate Intermediate MVN Correlation for Negative Binomial Variables: Correlation Method 1findintercorr_nb
Calculate Intermediate MVN Correlation for Poisson Variables: Correlation Method 1findintercorr_pois
Calculate Intermediate MVN Correlation for Poisson - Negative Binomial Variables: Correlation Method 1findintercorr_pois_nb
Calculate Intermediate MVN Correlation for Ordinal, Continuous, Poisson, or Negative Binomial Variables: Correlation Method 2findintercorr2
Fleishman's Third-Order Polynomial Transformation Equationsfleish
Fleishman's Third-Order Transformation Hessian Calculation for Lower Boundary of Standardized Kurtosis in Asymmetric Distributionsfleish_Hessian
Fleishman's Third-Order Transformation Lagrangean Constraints for Lower Boundary of Standardized Kurtosis in Asymmetric Distributionsfleish_skurt_check
Parameters for Examples of Constants Calculated by Headrick's Fifth-Order Polynomial TransformationH_params
Examples of Constants Calculated by Headrick's Fifth-Order Polynomial TransformationHeadrick.dist
Fleishman's Third-Order Polynomial Transformation Intermediate Correlation Equationsintercorr_fleish
Headrick's Fifth-Order Polynomial Transformation Intermediate Correlation Equationsintercorr_poly
Calculate Maximum Support Value for Count Variables: Correlation Method 2max_count_support
Generation of One Non-Normal Continuous Variable Using the Power Methodnonnormvar1
Calculate Intermediate MVN Correlation to Generate Variables Treated as Ordinalordnorm
Check Polynomial Transformation Constants for Valid Power Method PDFpdf_check
Plot Theoretical Power Method Cumulative Distribution Function for Continuous Variablesplot_cdf
Plot Theoretical Power Method Probability Density Function and Target PDF of External Data for Continuous Variablesplot_pdf_ext
Plot Theoretical Power Method Probability Density Function and Target PDF by Distribution Name or Function for Continuous Variablesplot_pdf_theory
Plot Simulated (Empirical) Cumulative Distribution Function for Continuous, Ordinal, or Count Variablesplot_sim_cdf
Plot Simulated Data and Target External Data for Continuous or Count Variablesplot_sim_ext
Plot Simulated Probability Density Function and Target PDF of External Data for Continuous or Count Variablesplot_sim_pdf_ext
Plot Simulated Probability Density Function and Target PDF by Distribution Name or Function for Continuous or Count Variablesplot_sim_pdf_theory
Plot Simulated Data and Target Distribution Data by Name or Function for Continuous or Count Variablesplot_sim_theory
Headrick's Fifth-Order Polynomial Transformation Equationspoly
Headrick's Fifth-Order Transformation Lagrangean Constraints for Lower Boundary of Standardized Kurtosispoly_skurt_check
Calculate Power Method Correlationpower_norm_corr
Generation of Correlated Ordinal, Continuous, Poisson, and/or Negative Binomial Variables: Correlation Method 1rcorrvar
Generation of Correlated Ordinal, Continuous, Poisson, and/or Negative Binomial Variables: Correlation Method 2rcorrvar2
Separate Target Correlation Matrix by Variable Typeseparate_rho
Calculate Simulated (Empirical) Cumulative Probabilitysim_cdf_prob
Simulation of Correlated Data with Multiple Variable TypesSimMultiCorrData-package SimMultiCorrData
Calculate Theoretical Statistics for a Valid Power Method PDFstats_pdf
Determine Correlation Bounds for Ordinal, Continuous, Poisson, and/or Negative Binomial Variables: Correlation Method 1valid_corr
Determine Correlation Bounds for Ordinal, Continuous, Poisson, and/or Negative Binomial Variables: Correlation Method 2valid_corr2
Calculate Variance of Binary or Ordinal Variablevar_cat