Specify prior for phi for multilevel beta regression in stan_glmer


#1

Hi - I’m using rstanarm and stan_glmer to run a a multilevel beta regression, but I can’t work out how to set a prior for phi. In the stan_betareg function you can specify prior_phi, but that doesn’t seem to be the case for the stan_glmer with family=mgcv::betar instance.
In addition - I can’t work out what the current default prior for phi is:

  • Running prior_summary on the model doesn’t show a prior for phi.
  • pp_validate throws a “Error in exp(eta) : non-numeric argument to mathematical function” that I assume is related to the error for posterior_predict (documented here Rstanarm: mgcv::betar family).

Any suggestions on how to proceed?


#2

The prior on phi in that case is whatever prior_aux is. So,

example(stan_betareg, ask = FALSE)
fake_dat$group <- rep(1:10, each = 20)
fit <- stan_glmer(y ~ x + (1 | group), data = fake_dat, family = mgcv::betar,
                  prior_aux = exponential(2))

#3

Great! Thank you @bgoodri! :)