data=readRDS("../../../Dropbox/simulationsmarch9/independentsim/independentsim.rds")
t=data$tstat;bhat=data$betahat;sebetahat=data$sebetahat;beta=data$beta;v.j=matrix(rep(1,ncol(t)*nrow(t)),ncol=ncol(t),nrow=nrow(t))
mash.means=read.table("../../../Dropbox/simulationsmay12/independentsim_all/independentsimashcutoffomega2jun15posterior.means.txt")[,-1]
ash.means=read.table("../../../Dropbox/simulationsmay12/independentsim_all/univariate.ash.pmind.txt")
bma.means=read.table("../../../Dropbox/simulationsmay12/independentsim_all/noashindependentwithzerobmaallposterior.means.txt")[,-1]
lfsr.mash=read.table("../../../Dropbox/simulationsmay12/independentsim_all/independentsimashcutoffomega2jun15lfsr.txt")[,-1]
lfsr.bma=read.table("../../../Dropbox/simulationsmay12/independentsim_all/noashindependentwithzerobmaalllfsr.txt")[,-1]
lfsr.ash=read.table("../../../Dropbox/simulationsmay12/independentsim_all/univariate.ashind.lfsr.txt")
standard.error=data$sebetahat
pm.mash.beta=mash.means*standard.error
pm.bma.beta=bma.means*standard.error
pm.ash.beta=ash.means*standard.error
thresh=0.05
Here, we show the Proportion of Sharing by Sign:
sigmat=(lfsr.mash<=thresh)
nsig= rowSums(sigmat)
#(signall=mean(het.norm(pm.mash.beta[nsig>0,])>0))
(signall.mash=mean(het.norm(pm.mash.beta[1:400,])>0))
## [1] 0.5125
##BMA
sigmat=(lfsr.bma<=thresh)
nsig= rowSums(sigmat)
#(signall=mean(het.norm(pm.bma.beta[nsig>0,])>0))
(signall.bma=mean(het.norm(pm.bma.beta[1:400,])>0))
## [1] 0.5119886
##ASH
sigmat=(lfsr.ash<thresh)
nsig= rowSums(sigmat)
#(signall=mean(het.norm(pm.ash.beta[nsig>0,])>0))
(signall.ash=mean(het.norm(pm.ash.beta[1:400,])>0))
## [1] 0.5119886
(truth=(mean(het.norm(data$beta[1:400,])>0)))
## [1] 0.5127841
(standard=mean(het.norm(data$betahat[1:400,])>0))
## [1] 0.5107386
(RMLE=sqrt(mean((standard-truth)^2)))
## [1] 0.002045455
(RRMSE.mash=sqrt(mean((signall.mash-truth)^2))/RMLE)
## [1] 0.1388889
(RRMSE.bma=sqrt(mean((signall.bma-truth)^2))/RMLE)
## [1] 0.3888889
(RRMSE.ash=sqrt(mean((signall.ash-truth)^2))/RMLE)
## [1] 0.3888889
rmse.all.table=cbind(mash=RRMSE.mash,bmalite=RRMSE.bma,ash=RRMSE.ash)
barplot(as.numeric(rmse.all.table),main="Shared, Unstructured Effects: Sign heterogeneity",
ylab="relative error (RRMSE)",xlab="Method",col=c("green","blue","red"),names=colnames(rmse.all.table),ylim=c(0,1.5),cex.main=1.5,cex.lab=1,cex.names=1,las=2)
data=readRDS("../../../Dropbox/simulationsmarch9/independentsim/independentsim.rds")
t=data$tstat;bhat=data$betahat;sebetahat=data$sebetahat;beta=data$beta;v.j=matrix(rep(1,ncol(t)*nrow(t)),ncol=ncol(t),nrow=nrow(t))
mash.means=read.table("../../../Dropbox/simulationsmay12/independentsim_all/independentsimashcutoffomega2jun15posterior.means.txt")[,-1]
ash.means=read.table("../../../Dropbox/simulationsmay12/independentsim_all/univariate.ash.pmind.txt")
bma.means=read.table("../../../Dropbox/simulationsmay12/independentsim_all/noashindependentwithzerobmaallposterior.means.txt")[,-1]
lfsr.mash=read.table("../../../Dropbox/simulationsmay12/independentsim_all/independentsimashcutoffomega2jun15lfsr.txt")[,-1]
lfsr.bma=read.table("../../../Dropbox/simulationsmay12/independentsim_all/noashindependentwithzerobmaalllfsr.txt")[,-1]
lfsr.ash=read.table("../../../Dropbox/simulationsmay12/independentsim_all/univariate.ashind.lfsr.txt")
standard.error=data$sebetahat
pm.mash.beta=mash.means*standard.error
pm.bma.beta=bma.means*standard.error
pm.ash.beta=ash.means*standard.error
thresh=0.05
Here, we show the Proportion of Sharing by Sign:
sigmat=(lfsr.mash<=thresh)
nsig= rowSums(sigmat)
(signall=mean(het.norm(pm.mash.beta[nsig>0,])>0.5))
## [1] 0.1285795
(signall.mash=mean(het.norm(pm.mash.beta[1:400,])>0.5))
## [1] 0.1285795
##BMA
sigmat=(lfsr.bma<=thresh)
nsig= rowSums(sigmat)
(signall=mean(het.norm(pm.bma.beta[nsig>0,])>0.5))
## [1] 0.1288068
(signall.bma=mean(het.norm(pm.bma.beta[1:400,])>0.5))
## [1] 0.1288068
##ASH
sigmat=(lfsr.ash<thresh)
nsig= rowSums(sigmat)
(signall=mean(het.norm(pm.ash.beta[nsig>0,])>0.5))
## [1] 0.1233225
(signall.ash=mean(het.norm(pm.ash.beta[1:400,])>0.5))
## [1] 0.1283523
####SHow that results are robust in specific analysis
(truth=(mean(het.norm(data$beta[1:400,])>0.5)))
## [1] 0.1277841
(standard=mean(het.norm(data$betahat[1:400,])>0.5))
## [1] 0.1286932
(RMLE=sqrt(mean((standard-truth)^2)))
## [1] 0.0009090909
(RRMSE.mash=sqrt(mean((signall.mash-truth)^2))/RMLE)
## [1] 0.875
(RRMSE.bma=sqrt(mean((signall.bma-truth)^2))/RMLE)
## [1] 1.125
(RRMSE.ash=sqrt(mean((signall.ash-truth)^2))/RMLE)
## [1] 0.625
rmse.all.table=cbind(mash=RRMSE.mash,bmalite=RRMSE.bma,ash=RRMSE.ash)
barplot(as.numeric(rmse.all.table),main="Shared, Untructured Effects: Sign heterogeneity",
ylab="relative error (RRMSE)",xlab="Method",col=c("green","blue","red"),names=colnames(rmse.all.table),ylim=c(0,1.5),cex.main=1.5,cex.lab=1,cex.names=1,las=2)