#### use hmat_sim to generate the simulated z-scores:
data(hmat_sim)
m <- nrow(hmat_sim)
set.seed(12)
zmat_sim1 <- matrix(rnorm(n=3*m,mean=hmat_sim*3),nrow=m,ncol=3)
rm(m,H)
data(zmat_sim)
stopifnot(all.equal(zmat_sim1,zmat_sim))
#### hmat_sim was generated by the following code:
H <- hconfigs(n.studies= 3, n.association.status=2)
f <- c(0.895,0.005,0.005,0.02,0.005,0.02,0.02,0.03) # frequencies for the association status vectors
m = 10000 # number of tests in each study
hmat_sim1 <- matrix(rep(x = H, times = m*cbind(f,f,f)),ncol=3)
data(hmat_sim)
stopifnot(all.equal(hmat_sim1,hmat_sim))
# the simulation design
cbind(H,f)
sum(f) # all sum to 1?
Run the code above in your browser using DataLab