# NOT RUN {
df_pooled <- data.frame("tau" = c(1, -1, .5, -.5, .7, -.7, 1.3, -1.3),
"se" = rep(1, 8),
"state" = datasets::state.name[1:8])
baggr(df_pooled) #baggr automatically detects the input data
# correct labels, different pooling & passing some options to Stan
baggr(df_pooled, group = "state", pooling = "full", iter = 500)
#change the priors:
baggr(df_pooled, prior_hypermean = normal(5,5))
# "mu & tau" model, using a built-in dataset
# prepare_ma() can summarise individual-level data
# }
# NOT RUN {
microcredit_summary_data <- prepare_ma(microcredit_simplified,
outcome = "consumerdurables")
baggr(microcredit_summary_data, model = "mutau",
pooling = "partial", prior_hypercor = lkj(1),
prior_hypersd = normal(0,10),
prior_hypermean = multinormal(c(0,0),matrix(c(10,3,3,10),2,2)))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab