Something like baggr(schools, pars = c("theta_k", "eta"), include = FALSE) but the list of pars will differ depending on model, so automate this via argument remove_pars = TRUE.
Then you must ensure that the thing works without m <- rstan::extract(bg$fit, pars = "theta_k")[[1]] in group_effects and instead prints out "effects for groups have not been saved" or something like that.
Something like
baggr(schools, pars = c("theta_k", "eta"), include = FALSE)
but the list of pars will differ depending on model, so automate this via argumentremove_pars = TRUE
.Then you must ensure that the thing works without
m <- rstan::extract(bg$fit, pars = "theta_k")[[1]]
ingroup_effects
and instead prints out "effects for groups have not been saved" or something like that.