11library(dplyr )
22library(ggplot2 )
3- load(" ../ dataFiles/res.wide.RData" )
3+ load(" dataFiles/res.wide.RData" )
44
55# res.wide$qrp.label <- factor(res.wide$qrpEnv, levels=c("none", "med", "high"), labels=paste0("QRP = ", c("none", "med", "high")), ordered=TRUE)
66# res.wide$delta.label <- factor(res.wide$delta, levels=c(0, 0.2, 0.5, 0.8), labels=paste0("delta = ", c(0, 0.2, 0.5, 0.8)), ordered=TRUE)
7- # res.wide$selProp.label <- factor(res.wide$selProp, levels=unique(res.wide$selProp), labels=paste0("PB = ", unique(res.wide$selProp)))
7+ # res.wide$censor <- factor(res.wide$selProp, levels=unique(res.wide$selProp), labels=paste0("PB = ", unique(res.wide$selProp)))
88
99# ---------------------------------------------------------------------
1010# Compute summary measures across replications
@@ -14,7 +14,7 @@ posify <- function(x) {x[x<0] <- 0; return(x)}
1414# use the data set without any reductions (i.e., also keep p-curves with <=3 sign. studies)
1515PC <- res.wide %> % filter(method == " pcurve" , ! is.na(kSig_estimate ) & kSig_estimate > = 1 )
1616
17- summ.PC <- PC %> % group_by(condition , k , k.label , delta , delta.label , qrpEnv , qrp.label , selProp , selProp .label , tau , tau.label ) %> %
17+ summ.PC <- PC %> % group_by(condition , k , k.label , delta , delta.label , qrpEnv , qrp.label , censor , censor .label , tau , tau.label ) %> %
1818 dplyr :: summarise(
1919 meanEst.AEO = mean(b0_estimate , na.rm = TRUE ),
2020 meanEst.pos.AEO = mean(posify(b0_estimate ), na.rm = TRUE ),
@@ -34,7 +34,7 @@ summ.PC <- PC %>% group_by(condition, k, k.label, delta, delta.label, qrpEnv, qr
3434
3535# average kSig in tau=0 conditions:
3636
37- summ.PC %> % filter(tau == 0 , delta < = 0.2 , qrpEnv == " none" , selProp == 0 ) %> % select(1 : 8 , nSig )
37+ summ.PC %> % filter(tau == 0 , delta == 0 , qrpEnv == " none" ) %> % select(1 : 8 , nSig )
3838
3939# ---------------------------------------------------------------------
4040# Plot
@@ -46,7 +46,7 @@ summ.PC %>%
4646 geom_hline(yintercept = 0 ) +
4747 coord_flip(ylim = c(- 0.4 , 0.25 )) +
4848 xlab(" k" ) + ylab(" Mean error (relative to average true effect size of studies submitted to p-curve)" ) +
49- facet_grid(tau.label ~ selProp.label ~ qrp.label ) +
49+ facet_grid(tau.label ~ censor ~ qrp.label ) +
5050 theme_bw() + ggtitle(" Effect size estimates (keep all), all p-curves (i.e., >= 4 study rule not applied)" )
5151
5252ggsave(" Plots/ME_AEO_raw.jpg" , dpi = 120 )
@@ -58,7 +58,7 @@ summ.PC %>%
5858 geom_hline(yintercept = 0 ) +
5959 coord_flip(ylim = c(- 0.4 , 0.25 )) +
6060 xlab(" k" ) + ylab(" Mean error (relative to average true effect size of studies submitted to p-curve)" ) +
61- facet_grid(tau.label ~ selProp.label ~ qrp.label ) +
61+ facet_grid(tau.label ~ censor ~ qrp.label ) +
6262 theme_bw() + ggtitle(" Posified effect size estimates, all p-curves (i.e., >= 4 study rule not applied)" )
6363
6464ggsave(" Plots/ME_AEO_pos.jpg" , dpi = 120 )
@@ -74,7 +74,7 @@ summ.PC %>%
7474 geom_hline(yintercept = 0 ) +
7575 coord_flip(ylim = c(0 , 0.8 )) +
7676 xlab(" k" ) + ylab(" RMSE (relative to average true effect size of studies submitted to p-curve)" ) +
77- facet_grid(tau.label ~ selProp.label ~ qrp.label ) +
77+ facet_grid(tau.label ~ censor ~ qrp.label ) +
7878 theme_bw() + ggtitle(" Effect size estimates (keep all), all p-curves (i.e., >= 4 study rule not applied)" )
7979
8080ggsave(" Plots/RMSE_AEO.jpg" , dpi = 120 )
@@ -85,7 +85,7 @@ summ.PC %>%
8585 geom_hline(yintercept = 0 ) +
8686 coord_flip(ylim = c(0 , 0.8 )) +
8787 xlab(" k" ) + ylab(" RMSE (relative to average true effect size of studies submitted to p-curve)" ) +
88- facet_grid(tau.label ~ selProp.label ~ qrp.label ) +
88+ facet_grid(tau.label ~ censor ~ qrp.label ) +
8989 theme_bw() + ggtitle(" Posified effect size estimates, all p-curves (i.e., >= 4 study rule not applied)" )
9090
9191ggsave(" Plots/RMSE_AEO_pos.jpg" , dpi = 120 )
0 commit comments