I would like to fit some Bayesian models using brms and using the purrr::nest() function and the brms::update() function.
Assume you have a data set (dataset) with the following columns: y, By_factor, x, ID
And suppose there are say 30 unique By-factor levels, here the ID is the patient ID say.
To avoid compiling the brms code when I run each of the 30 models, I would like to use the update function.
So I would fit the first models as
mod0 <- dataset %>% filter(By_factor=="1") %>% brm(y~x+(1|ID))
Now how can I proceed to fit the other 29 models (using purrr:nest , tidy and brms::update)?
Thanks in advance,