Hi,
I have been trying to compare levels from a binomial model.
If I try the following, I run into and error:
fit1 <- brm(incidence | trials(size) ~ period + (1|herd),
data = cbpp, family = binomial())
cbpp%>%add_epred_draws(fit1, re_formula = NA)%>%
compare_levels(variable = .epred,by="period") %>%
mean_qi()
Error in combn(levels(x), 2, simplify = FALSE) : n < m
If I try:
cbpp%>%dplyr::select(period)%>%unique()%>%add_epred_draws(fit1, re_formula = NA)%>%
compare_levels(variable = .epred,by="period") %>%
mean_qi()
Error: The following variables can neither be found in 'data' nor in 'data2':
'size'
Any suggestions of how to make it work?
Thanks