s_modules {eclust} | R Documentation |
Simulate Covariates With Exposure Dependent Correlations
Description
This is a wrapper of the simulateDatExpr
function which simulates data in a modular structure (i.e. in blocks). This
function simulates data in 5 blocks referred to as Turquoise, Blue, Red,
Green and Yellow, separately for exposed (E=1) and unexposed (E=0)
observations.
Usage
s_modules(n, p, rho, exposed, ...)
Arguments
n |
number of observations |
p |
total number of predictors to simulate |
rho |
numeric value representing the expected correlation between green module and red module |
exposed |
binary numeric vector of length |
... |
arguments passed to the |
Value
n x p
matrix of simulated data
Examples
library(magrittr)
p <- 1000
n <- 200
d0 <- s_modules(n = 100, p = 1000, rho = 0, exposed = FALSE,
modProportions = c(0.15,0.15,0.15,0.15,0.15,0.25),
minCor = 0.01,
maxCor = 1,
corPower = 1,
propNegativeCor = 0.3,
backgroundNoise = 0.5,
signed = FALSE,
leaveOut = 1:4)
d1 <- s_modules(n = 100, p = 1000, rho = 0.90, exposed = TRUE,
modProportions = c(0.15,0.15,0.15,0.15,0.15,0.25),
minCor = 0.4,
maxCor = 1,
corPower = 0.3,
propNegativeCor = 0.3,
backgroundNoise = 0.5,
signed = FALSE)
X <- rbind(d0$datExpr, d1$datExpr) %>%
magrittr::set_colnames(paste0("Gene", 1:p)) %>%
magrittr::set_rownames(paste0("Subject",1:n))
dim(X)
[Package eclust version 0.1.0 Index]