The following code generate Tables from simulation in the appednix. 5 independent simulation are performed. All simulations RData files can be accessed at this online folder http://www.tonyjhwueng.info/ououcir/simulation64V3set3.
rm(list=ls())
library(knitr)
load(url("http://www.tonyjhwueng.info/ououcir/nonunifsimtable.RData"))
kable(bigoutputtable)
| model | taxa | alpha.y | alpha.x | theta.x | sigmasq.x | tau | alpha.tau | theta.tau | sigmasq.tau | b0 | b1 | b2 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| oubmbm | 16 | 0.21 (0.01,0.62) | NA | NA | 0.36 (0.12,0.84) | 0.9 (0.2,2.59) | NA | NA | NA | 0.21 (-4.33,4.3) | -1.8 (-6.17,2.5) | 2.58 (-1.57,7.22) |
| oubmbm | 32 | 0.21 (0.01,0.62) | NA | NA | 0.39 (0.13,0.79) | 1.04 (0.22,2.87) | NA | NA | NA | -0.07 (-4.39,4.52) | -1.72 (-6.36,2.54) | 2.63 (-1.48,7.06) |
| oubmbm | 64 | 0.19 (0.01,0.54) | NA | NA | 0.38 (0.14,0.73) | 1.11 (0.2,3.04) | NA | NA | NA | 0.16 (-4.54,4.47) | -1.58 (-6.25,2.6) | 2.51 (-1.57,7.22) |
| oubmbm | 128 | 0.2 (0.01,0.6) | NA | NA | 0.35 (0.14,0.69) | 0.95 (0.22,2.84) | NA | NA | NA | 0.05 (-4.62,4.47) | -1.73 (-6.18,2.54) | 2.5 (-1.54,7.08) |
| ououbm | 16 | 0.24 (0.05,0.55) | 0.11 (0.01,0.29) | 0.01 (-1.61,1.55) | 0.37 (0.12,0.82) | 0.69 (0.2,1.73) | NA | NA | NA | -0.02 (-4.39,4.56) | -2.37 (-6.6,2.74) | 2.76 (-1.61,7.53) |
| ououbm | 32 | 0.2 (0.03,0.47) | 0.11 (0.01,0.32) | -0.05 (-1.7,1.53) | 0.43 (0.17,0.86) | 0.63 (0.19,1.51) | NA | NA | NA | 0.07 (-4.53,4.62) | -1.88 (-6.34,2.5) | 3.56 (-1.26,7.62) |
| ououbm | 64 | 0.25 (0.06,0.55) | 0.1 (0,0.3) | -0.04 (-1.59,1.59) | 0.43 (0.14,0.92) | 0.64 (0.2,1.59) | NA | NA | NA | 0.18 (-4.44,4.55) | -2.29 (-6.6,2.26) | 3.83 (-1.55,7.65) |
| ououbm | 128 | 0.23 (0.04,0.53) | 0.11 (0,0.33) | -0.02 (-1.69,1.74) | 0.38 (0.16,0.75) | 0.62 (0.21,1.46) | NA | NA | NA | -0.08 (-4.63,4.41) | -1.85 (-6.24,2.45) | 3.57 (-1.57,7.5) |
| oubmcir | 16 | 0.21 (0.01,0.65) | NA | NA | 0.38 (0.15,0.75) | NA | 0.24 (0.01,0.7) | 1.53 (1.07,2.1) | 0.92 (0.2,2.13) | -0.01 (-4.48,4.44) | -1.91 (-6.46,2.55) | 2.91 (-1.52,7.4) |
| oubmcir | 32 | 0.21 (0.01,0.63) | NA | NA | 0.39 (0.13,0.83) | NA | 0.25 (0.01,0.74) | 1.54 (1.08,2.11) | 0.78 (0.21,2.03) | -0.04 (-4.5,4.37) | -2.11 (-6.53,2.58) | 3.11 (-1.49,7.56) |
| oubmcir | 64 | 0.19 (0.01,0.57) | NA | NA | 0.44 (0.18,0.86) | NA | 0.28 (0.02,0.79) | 1.54 (1.09,2.14) | 0.7 (0.22,1.73) | -0.18 (-4.61,4.42) | -2.14 (-6.58,2.48) | 3.18 (-1.49,7.47) |
| oubmcir | 128 | 0.16 (0.01,0.47) | NA | NA | 0.37 (0.14,0.75) | NA | 0.26 (0.02,0.77) | 1.54 (1.08,2.09) | 0.92 (0.27,2.21) | -0.06 (-4.49,4.56) | -1.67 (-6.33,2.43) | 2.48 (-1.56,7.21) |
| ououcir | 16 | 0.23 (0.02,0.59) | 0.12 (0.01,0.34) | 0.07 (-1.4,1.7) | 0.35 (0.11,0.69) | NA | 0.28 (0.01,0.95) | 1.53 (1.1,2.03) | 0.73 (0.18,1.59) | -0.17 (-4.34,4.53) | -1.77 (-6.17,2.49) | 2.98 (-1.48,7.49) |
| ououcir | 32 | 0.21 (0.01,0.54) | 0.13 (0.01,0.37) | -0.02 (-1.48,1.68) | 0.33 (0.12,0.7) | NA | 0.29 (0.02,0.89) | 1.57 (1.09,2.17) | 0.73 (0.2,1.97) | -0.03 (-4.64,4.51) | -1.68 (-6.25,2.43) | 2.9 (-1.28,7.45) |
| ououcir | 64 | 0.2 (0.01,0.65) | 0.14 (0.01,0.4) | -0.07 (-1.95,1.67) | 0.35 (0.11,0.75) | NA | 0.26 (0.02,0.75) | 1.54 (1.1,2.08) | 0.74 (0.18,1.72) | 0.03 (-4.43,4.28) | -2.36 (-6.37,2.25) | 3.04 (-1.56,7.26) |
| ououcir | 128 | 0.18 (0.01,0.55) | 0.13 (0.01,0.41) | 0.05 (-1.69,1.71) | 0.4 (0.14,0.86) | NA | 0.26 (0.01,0.71) | 1.55 (1.16,2.08) | 0.61 (0.21,1.43) | -0.02 (-4.3,4.5) | -2.13 (-6.52,2.52) | 2.66 (-1.46,7.23) |
The following is raw code by loading RData across 5 sims.
### BIG TABLE FOR ALL PARAMETERS IN MODELS
rm(list=ls())
library(xtable)
simfolder<-"http://www.tonyjhwueng.info/ououcir/simulation64V3set3/"
simsets<-paste("nonuniformset",1:5,sep="")
foldername<-c("oubmbm","ououbm","oubmcir","ououcir")
n.array<-c(16,32,64,128)
bigoutputtable<- array(NA,c(16,13))
colnames(bigoutputtable)<-c("model","taxa","alpha.y","alpha.x","theta.x","sigmasq.x","tau","alpha.tau","theta.tau","sigmasq.tau","b0","b1","b2")
bigoutputtable[,1]<-rep(c("oubmbm","ououbm","oubmcir","ououcir") ,each=4)
bigoutputtable[,2]<-rep(c(16,32,64,128) ,times=4)
count<-0
for(folderIndex in 1: length(foldername)){
# folderIndex<-1
for(sizeIndex in 1:length(n.array)){
# sizeIndex<-1
count<-count+1
postsample<-NULL
for(simsetIndex in 1:length(simsets)){
# simsetIndex<-1
folder<-paste(simfolder,simsets[simsetIndex],"/",foldername[folderIndex],sep = "")
# folder
setwd(folder)
rfile<-paste(foldername[folderIndex],"SimV2size",n.array[sizeIndex],".RData",sep="")
try(load(rfile))
postsample<-rbind(postsample,get(paste("post.",foldername[folderIndex],sep="")))
}
meanpost<-round(apply(postsample,2, median),2)
qrpost<-round(apply(postsample,2,quantile,probs=c(0.05,0.95)),2)
meanqrpost<-paste(meanpost," (",qrpost[1,],",",qrpost[2,],")",sep="")
names(meanqrpost)<-names(meanpost)
fillposition<-colnames(bigoutputtable)%in%names(meanpost)
bigoutputtable[count,fillposition]<-meanqrpost
}
}
print(bigoutputtable)
xtable(bigoutputtable[,1:10])
xtable(bigoutputtable[,c(1,2,11:13)])
save(bigoutputtable,file="nonunifsimtable.RData")