Description Usage Arguments Value Author(s) Examples
Generate observations from each hypothesis (null/alternative) group based on dependent normal distribution
1 2 3 4 5 | sample.null.dep(ngenes.null.dep, n, var.ratio, cov.matrix,
ngenes.matrix, distrn = "normal")
sample.alt.dep(ngenes.alt.dep, n, var.ratio, cov.matrix, ngenes.matrix,
delta, distrn = "normal")
|
ngenes.null.dep |
an integer number for the number of observations (gene expression values) to simulate for genes coming from true null hypothesis |
n |
number of replicates for each group of control/treatment |
var.ratio |
ratio of variance between treatment/control |
cov.matrix |
a list of covariance matrices to sample the covariance from |
ngenes.matrix |
the number of covariance matrices in the list of cov.matrix |
distrn |
always being normal |
ngenes.alt.dep |
an integer number for the number of observations (gene expression values) to simulate for genes coming from true alternative hypothesis |
delta |
effect size for sample size calculation the absolute distance from zero for expression values of genes coming from the true alternative hypothesis group |
returns a matrix with ngenes.***.dep rows and 2*n columns with the first n columns being samples from control group and last n columns being from treatment group for each gene (row). each group of genes consists of subgroups of genes that are dependent
Peng Liu peng\_liu@groton.pfizer.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(MASS)
ngenes.null.dep <- ngenes.alt.dep <- 10
n <- 1000; delta <- 50; var.ratio <- 1;
ngenes.matrix <- 7; cov.matrix <- list(ngenes.matrix);
for ( i in c(1:ngenes.matrix)) {
cov.matrix[[i]] <- diag(rep(i*0.1, i+1))
# cov.matrix[[i]] <- diag(rep(i*0.1,4))
}
cov.matrix[[4]][1,1] <- cov.matrix[[5]][1,1] <- cov.matrix[[6]][1,1] <- 1
cov.matrix[[4]][2,1] <- cov.matrix[[4]][1,2] <- 0.15 # corr = 0.15 / (1*0.2) = 0.75
cov.matrix[[5]][2,1] <- cov.matrix[[5]][1,2] <- 0.5 # corr = 0.15 /(1*sqrt(0.5)) = 0.59
cov.matrix[[7]][1,1] <- 10
cov.matrix[[7]][2,1] <- cov.matrix[[7]][1,2] <- 0.6 # corr = 0.67
cov.matrix[[7]][3,1] <- cov.matrix[[7]][1,3] <- 0.5
cov.matrix[[7]][3,2] <- cov.matrix[[7]][2,3] <- 0.4
test.sample.null.dep <- sample.null.dep(ngenes.null.dep , n, var.ratio,
cov.matrix, ngenes.matrix)
test.sample.alt.dep <- sample.alt.dep(ngenes.alt.dep , n, var.ratio,
cov.matrix, ngenes.matrix, delta)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.