SimCorrMix
0.1.1Simulation of Correlated Data with Multiple Variable Types Including Continuous and Count Mixture Distributions
Overview
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.
Install
Health
- NOTE r-devel-linux-x86_64-debian-clang
- NOTE r-devel-linux-x86_64-debian-gcc
- NOTE r-devel-linux-x86_64-fedora-clang
- NOTE r-devel-linux-x86_64-fedora-gcc
- NOTE2026-03-107 OK · 7 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
Documentation
- Examples that run
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- References docs
- 97%
Downloads
Repository
Stars over time
Forks over time
Issues over time
Repository practices
4 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/afialkowski/simcorrmix on 2026-08-16.
Dependencies
Nothing depends on this yet.
Code & Tests
People & History
Author records are not tracked yet for this package.
2 releases. Pick two to compare their code metrics. R releases are shown for context.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- 0.1.1Latest
- RR 3.5.0 released · 2018-04-23
- 0.1.02018-02-26
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2018-02-26
- Total releases
- 2 / 8 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 3.4.0
- Download size
- 1.6 MB
- Installed size
- not tracked yet
- With dependencies
- not tracked yet
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("SimCorrMix")Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-08-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.