Description Usage Arguments Details Value Author(s) Examples
Simulate a sample to do t test
1 | simu.sample.real(sd.null, sd.alt, cov.null, ngenes.null.dep, cov.alt, ngenes.alt.dep, n, var.ratio, delta)
|
sd.null |
sd vector for observations that are independent and come from Ho |
sd.alt |
sd vector for observations that are independent and come from Ha |
cov.null |
list of covariance matrices for observations that are dependent and come from Ho |
ngenes.null.dep |
number of observations in dependent groups for observations coming from Ho |
cov.alt |
list of covariance matrices for observations that are dependent and come from Ha |
ngenes.alt.dep |
number of observations in dependent groups for observations coming from Ha |
n |
number of replicates to simulate for each group of control/treatment |
var.ratio |
ratio of variance between treatment/control |
delta |
effect size for sample size calculation the absolute distance from null value for expression values of genes coming from Ha group |
simulate observations from both control group and treatment group
returns a matrix of data with each row for a observation and columns are replicates, observations from Ho group occupy first rows followed by observations from Ha first n columns are from control group and second n columns are from treatment group
Peng Liu peng_liu@groton.pfizer.com
1 2 3 4 5 6 7 8 9 10 11 12 | library(MASS)
sd.null <- rep(0.1,4); sd.alt <- rep(0.2,5);
cov.null <- cov.alt <- list(2)
cov.null[[1]] <- cov.alt[[1]] <- cbind(c(0.1, 0.05), c(0.05,0.2));
cov.null[[2]] <- cbind(c(0.15, 0.05), c(0.05,0.2));
cov.alt[[2]] <- cbind(c(0.039, -0.037, 0.018), c(-0.037, 0.045, -0.021),
c(0.018, -0.021, 0.013));
test <- simu.sample.real(sd.null, sd.alt, cov.null, ngenes.null.dep = 4,
cov.alt, ngenes.alt.dep=5, n = 15, var.ratio = 1, delta = 5)
# dim(test) should be [18,30]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.