I guess you're making a semantic distinction in terms of what a
"posterior prediction" is? What I'm trying to predict is a quantity of
interest that's derived from the posterior; I don't think I'm doing
anything weird here. But I can see why it's not at all easy to make
this automatic.
In case it's helpful for anyone...here's a quick workaround which just
zeros out the draws for the parameter I don't care about (feedback
welcome):
i = grep("^b\\[",rownames(model$stan_summary))[1]
j = which(rownames(model$stan_summary) == "b[(Intercept)
studyid:_NEW_studyid]")
m = length(model$stanfit@sim$samples[[1]][[1]])
for(k in 1:length(model$stanfit@sim$samples))
model$stanfit@sim$samples[[k]][[paste0("b[",j - i + 1,"]")]] = rep(0,m)
predictions = posterior_predict(model, data)