Package: SimCorrMix 0.1.1
SimCorrMix: Simulation of Correlated Data with Multiple Variable Types Including Continuous and Count Mixture Distributions
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.
Authors:
SimCorrMix_0.1.1.tar.gz
SimCorrMix_0.1.1.zip(r-4.5)SimCorrMix_0.1.1.zip(r-4.4)SimCorrMix_0.1.1.zip(r-4.3)
SimCorrMix_0.1.1.tgz(r-4.4-any)SimCorrMix_0.1.1.tgz(r-4.3-any)
SimCorrMix_0.1.1.tar.gz(r-4.5-noble)SimCorrMix_0.1.1.tar.gz(r-4.4-noble)
SimCorrMix_0.1.1.tgz(r-4.4-emscripten)SimCorrMix_0.1.1.tgz(r-4.3-emscripten)
SimCorrMix.pdf |SimCorrMix.html✨
SimCorrMix/json (API)
NEWS
# Install 'SimCorrMix' in R: |
install.packages('SimCorrMix', repos = c('https://afialkowski.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/afialkowski/simcorrmix/issues
Last updated 6 years agofrom:32f2aa8211. Checks:OK: 1 NOTE: 6. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Nov 03 2024 |
R-4.5-win | NOTE | Nov 03 2024 |
R-4.5-linux | NOTE | Nov 03 2024 |
R-4.4-win | NOTE | Nov 03 2024 |
R-4.4-mac | NOTE | Nov 03 2024 |
R-4.3-win | NOTE | Nov 03 2024 |
R-4.3-mac | NOTE | Nov 03 2024 |
Exports:calc_mixmomentscontmixvar1corr_errorcorrvarcorrvar2intercorrintercorr_cat_nbintercorr_cat_poisintercorr_contintercorr_cont_nbintercorr_cont_nb2intercorr_cont_poisintercorr_cont_pois2intercorr_nbintercorr_poisintercorr_pois_nbintercorr2maxcount_supportnorm_ordord_normplot_simpdf_theoryplot_simtheoryrho_M1M2rho_M1Ysummary_varvalidcorrvalidcorr2validpar
Dependencies:assertthatBBclicolorspacefansifarverGenOrdggplot2glueGPArotationgtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmnormtmunsellmvtnormnleqslvnlmepillarpkgconfigpsychquadprogR6RColorBrewerrlangscalesSimMultiCorrDatatibbletriangleutf8vctrsVGAMviridisLitewithr
Comparison of Correlation Methods 1 and 2
Rendered frommethod_comp.Rmd
usingknitr::rmarkdown
on Nov 03 2024.Last update: 2018-02-23
Started: 2017-11-30
Continuous Mixture Distributions
Rendered fromcont_mixture.Rmd
usingknitr::rmarkdown
on Nov 03 2024.Last update: 2018-02-23
Started: 2017-11-30
Expected Cumulants and Correlations for Continuous Mixture Variables
Rendered fromcorr_mixture.Rmd
usingknitr::rmarkdown
on Nov 03 2024.Last update: 2018-01-12
Started: 2017-11-30
Overall Workflow for Generation of Correlated Data
Rendered fromworkflow.Rmd
usingknitr::rmarkdown
on Nov 03 2024.Last update: 2018-02-23
Started: 2017-11-30
Variable Types
Rendered fromvariable_types.Rmd
usingknitr::rmarkdown
on Nov 03 2024.Last update: 2018-02-23
Started: 2017-11-30