I’m fitting a logistic risk model on hospital data, given Region and Class predictors, with cases and denominators for each observation, with the aim of making simulations.
the model is:
brm(cases | trials(num) ~ (1 | Region / Class), family = binomial(), data = DF, chains = 8, cores = 8, iter = 8000)
I would like to predict the per hospital risk, but
predict.brmsfit() produces only the predicted count of events, and does not take a
type = 'response' argument as
predict.glm() to predict risk. I could use
posterior_linpred() and then
invlogit() but it doesn’t include the residual error in the prediction, which I need.
What am I missing?