Description Usage Arguments Details Value Author(s) Examples
Sample a list of covariance matrices that has the total number as ngenes.dep
1 | sampling.cov.matrix.2(cov.list, ngenes.dep)
|
cov.list |
the list a covariance matrices to sample from |
ngenes.dep |
the total number of dependent observations to sample |
to be called by sample.dep.2
returns a list of covariance matrices with the total number of dimension equal to the number of dependent observations to simulate
Peng Liu peng_liu@groton.pfizer.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ngenes <- 7; cov.matrix <- list(ngenes);
for ( i in c(1:ngenes)) {
cov.matrix[[i]] <- diag(rep(i*0.1, 50))
}
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.cov <- sampling.cov.matrix.2(cov.matrix, ngenes = 10)
test.cov2 <- sampling.cov.matrix.2(cov.matrix, ngenes = 60)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.