wwiecek / baggr

R package for Bayesian meta-analysis models, using Stan
GNU General Public License v3.0
46 stars 12 forks source link

Effectts plot and forest plot for quantiles #67

Open wwiecek opened 4 years ago

wwiecek commented 4 years ago

Effect_plot is only possible for models with 1-dimensional treatment effects forest_plot only works with 1-dimensional effects

K <- 7
N0 <- 50*K
N1 <- 51*K
sites0 <- rep(seq(1:7), N0/K)
sites1 <- rep(seq(1:7), N1/K)
y0 <- rnorm(N0,50 + sites0, 10)
y1 <- rnorm(N1,60 + sites1, 20)
chosen_quantiles <- c(0.2,0.4,0.5)
Q <- length(chosen_quantiles)
N1 <- length(y1)
N0 <- length(y0)
df_quantiles <- rbind(
  data.frame(outcome = y0, treatment = 0, group = sites0),
  data.frame(outcome = y1, treatment = 1, group = sites1)
)

bg5_ppd <- expect_warning(baggr(df_quantiles, "quantiles", ppd = T,
                                quantiles = chosen_quantiles,
                                iter = 200, chains = 2, refresh = 0,
                                show_messages = F))
wwiecek commented 4 years ago

For now this is disabled in test_quantiles, should re-enable once done

wwiecek commented 4 years ago

Also in this category: effect_draw for quantiles model. It seems to work, but surely it is wrong, because dimensionality is wrong

wwiecek commented 4 years ago

effect_draw is now fixed