## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)

## ----per_group_anchor_example, eval=FALSE-------------------------------------
# spec <- amm_spec(a = ~ x1 + x2)  # no factor(group): C7 ok
# fit  <- gdpar(y ~ x1 + x2, amm = spec, data = df, group = ~ school)
# coef(fit)$mu_theta_ref          # population-level mu
# coef(fit)$sigma_theta_ref       # population-level sigma
# coef(fit)$theta_ref             # per-school anchors (g, k, mean, q05, q50, q95)
# predict(fit, newdata = new_df)  # known schools: posterior; new school: prior predictive marginal

