Please also provide the following information in addition to your question:
•Operating System: Windows 10
•brms Version: 2.2.0
I have used the brm function to run hierarchical models and then used the posterior_predict function on the generated models without issues (details on how we have defined the model can be found here: Running time for hierarchical model ). However, I have now calculated the same models with the addition of using weights, using this formula in the brm function: yi | weights(wei) ~ predictors (i.e. the only change in the model formulae is the inclusion of the weights, all other arguments are identical to the unweighted models). When trying to use posterior_predict on the weighted models I am given the following error message: “Something went wrong. Did you transform numeric variables to factors or vice versa within the model formula? If yes, please convert your variables beforehand. Or did you set a predictor variable to NA? If no to both, this might be a bug. Please tell me about it.” I did not transform the variables and there are no NA’s in the data used.
Since the inclusion of weights is the only change in the weighted model I assume that this is what is causing trouble, but I cannot figure out how or why. Do you have any suggestions?
Thanks in advance for your reply.