Hi everyone,
Does anyone know how to extract the final positions of the first four chains in brms? I know that tidybayes offers the spread_draws function but I’m not sure how to use it in that context.
Following Extracting and visualizing tidy draws from brms models
I’ve created the following code:
brmfit_1 <- brm(pid ~ ageR + ageR2 + cohort + (1 + cohort | country) + (1 | year),
data = df_cleaned,
family = bernoulli(link = "logit"),
iter = 1000, ## instead of 2000
file = "brmfit_1.rds")
brmfit_1_values <- brmfit_1 %>%
spread_draws(b_Intercept, sigma) %>% ## Not sure if it works
filter(.iteration == 1000)