Description Usage Arguments Value See Also Examples
The phenotypes are simulated according to a logistic regression model.
Depending on the chosen configuration in sample_SNP
, the model
includes different effect types: synergistic effects with the target,
marginal effects and additional epistatic effects. We offer the option to
generate a balanced phenotype vector between cases and controls, through the
intercept
parameter.
1 | sim_phenotype(X, causal, model, intercept = TRUE)
|
X |
genotype matrix |
causal |
causal SNPs. |
model |
disease model |
intercept |
binary flag. If |
A vector of simulated phenotypes which are encoded as a two-level factor (TRUE/FALSE).
sample_SNP
and gen_model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | nX <- 5
nY <- 3
nZ12 <- 2
clusters <- rep(seq_len(25), each = 3)
names(clusters) <- paste0("SNP_", seq_along(clusters))
MAF <- runif(length(clusters), min = 0.2, max = 0.5)
n_samples <- 3
X <- matrix((runif(n_samples * length(clusters)) < 0.4) +
(runif(n_samples * length(clusters)) < 0.4),
ncol = length(clusters), nrow = n_samples)
colnames(X) <- names(clusters)
causal <- sample_SNP(
nX, nY, nZ12, clusters, MAF, thresh_MAF = 0.2, window_size = 2,
overlap_inter = 0)
model <- gen_model(nX, nY, nZ12, mean = rnorm(4), sd = rep(1, 4))
Y <- sim_phenotype(X, causal, model, intercept = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.