#Example 1: Two-layer HEM
data(pbrain)
##construct a design matrix
cond <- c(1,1,1,1,1,1,2,2,2,2,2,2) #condition
ind <- c(1,1,2,2,3,3,1,1,2,2,3,3) #biological replicate
rep <- c(1,2,1,2,1,2,1,2,1,2,1,2) #experimental replicate
design <- data.frame(cond,ind,rep)
##normalization
pbrain.nor <- hem.preproc(pbrain[,2:13])
##fit HEM with two layers of error
##using the small numbers of burn-ins and MCMC samples for a testing purpose;
##but increase the numbers for a practical purpose
#pbrain.hem <- hem(pbrain.nor, n.layer=2, design=design,
# burn.ins=10, n.samples=30)
##print H-scores
#pbrain.hem$H
#Example 2: One-layer HEM
data(mubcp)
##construct a design matrix
cond <- c(rep(1,6),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
ind <- c(1:6,rep((1:5),4))
design <- data.frame(cond,ind)
##construct a design matrix
mubcp.nor <- hem.preproc(mubcp)
#fit HEM with one layers of error
#using the small numbers of burn-ins and MCMC samples for a testing purpose;
#but increase the numbers for a practical purpose
#mubcp.hem <- hem(mubcp.nor, n.layer=1,design=design, burn.ins=10, n.samples=30)
##print H-scores
#mubcp.hem$H
###NOTE: Use 'hem.fdr' for FDR evaluation
###NOTE: Use 'hem.eb.prior' for Empirical Bayes (EB) prior sepecification
###NOTE: Use EB-HEM ('hem' after 'hem.eb.prior') for small data sets
Run the code above in your browser using DataLab