Adding a varying intercept for mu in beta_proportion model when mu is a vector of parameters

As I mostly write my own Stan models, I don’t know how to do this in brms. If there is documentation on it, I would imagine it’s called something like “errors in variables”.

If you want to write your own Stan model, go for it. The model should include a hierarchical logistic model for the sample-level (i) and site-level (j) expected proportion p_{ij}, which would look something like:

logit(p_{ij}) = \beta_0 + \beta_j + \beta_{ij}

Here, the last two terms are the site-level and sample-level deviations from the overall mean and site-level logit-probability, respectively.

You can then use the inverse logit of \beta_0 + \beta_j (or any transformation of it) as a site-level predictor for your outcome of interest. Or even use \beta_0 + \beta_j + \beta_{ij} as a sample-level predictor, if that’s what you’re looking for.

EDIT: equation formatting

1 Like