wwiecek / baggr

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

add a new diff-in-diff inspired example #99

Open wwiecek opened 3 years ago

wwiecek commented 3 years ago

Based on the chicken brain data, showing

Rubin a model with baselines a model with baselines and joint prior individual-level data model version of all of the above

library(baggr)
N <- 30
Ns <- 10
chicks <- data.frame(
  y0 = rnorm(Ns, 0, 1),
  se.y0 = 1,
  y1 = rnorm(Ns, 5, 1),
  se.y1 = 1
)

chicks %>% rename(tau = y1, se = se.y1) %>% baggr(refresh=0)
chicks %>% rename(tau = y1, se.tau = se.y1, mu = y0, se.mu = se.y0) %>% baggr(refresh=0, model = "mutau")