Description Usage Arguments Details Value Examples
simulator_ewas_real : function to simulate DNA methylation data for EWAS (looking like real data)
1 2 3 4 | simulator_ewas_real(n = 100, p = 500, K = 5, freq = NULL,
sd.freq = 1, prop.causal = 0.01, prop.variance = 0.4, sigma = 1,
sd.A = 0.2, mean.A = 1, sd.U = 1, sd.V = 1, pour = prop.causal
* 2)
|
n |
: number of individuals |
p |
: number of cpg variables |
K |
: number of latent factors |
freq |
: (vector) mean methylation values (if NULL, set randomly) |
prop.causal |
: proportion of causal variables (probes/loci) |
prop.variance |
: proportion of exposure variance explained by latent structure (intensity of confounding) |
sigma |
: standard deviation of residual errors |
sd.A |
: standard deviation for effect sizes |
mean.A |
: (vector) mean of effect sizes |
sd.U |
: (vector) standard deviations for factors |
sd.V |
: standard deviations for loadings |
This function is used to simulate datasets for EWAS. The simulation model is based on linear relationships. First, it construct a covariance matrix for X and U and prop.variance (intensity of the confounders or correlation between X and U). Then this matrix is used to simulate via normal laws X and U. Thereafter, the effect sizes of X (A) and U (V) are calculated using mean parameters of effect sizes (meanA) and standard deviations (sdA and sdV). Note that the effect sizes of X are calculated only for causal mediators with X. For non-causal mediators, the effect sizes is 0. On the other hand, a residual error matrix is calculated via the sigma (Z) parameter. To finish the methylation matrix is calculated thanks to the formula : Y = V*U + A*X + Z NEED IMPROVEMENT
Y : matrix of methylation beta values
Ynorm : pnorm(Y)
X : exposure
A : effect sizes exposure
causal : set of CpGs associated with the exposure
U : simulated confounders
V : loadings of coufounders
freq : mean methylation values
1 2 | # Simulate data :
simu <- simulator_ewas_real(100, 500, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.