Cumulative ordinal model in brms without any observations of one category

A brute-force way to do this would be to include at least one observation from each of the unobserved categories with zero weight. That way the model recognizes the original ordering of the categories but the unobserved cases don’t influence the likelihood.

# One outcome category weighted 0
data3 <- expand_grid(y = y1, x)
data3$w <- ifelse(data3$y == 'd', 0, 1) # If `d`, set weight to 0. Otherwise set to 1

# One outcome category unobserved; y|weights(w) ~ x
fit3 <- brm(
  y|weights(w) ~ x,
  data3, 
  family = cumulative(link = "logit")
)
summary(fit3)
conditional_effects(fit3, "x", categorical = TRUE)
posterior_epred(fit3, newdata = data.frame(x = c("U")))[1, 1, ]

summary(fit3)$fixed %>%
  as.data.frame() %>%
  rownames_to_column('predictor') %>%
  filter(predictor != 'xV')  %>%
  mutate(threshold = 1:n()) %>%
  ggplot(aes(threshold, Estimate)) +
    geom_line() +
    geom_point(size = 2, shape = 21, fill = 'white') +
    scale_x_continuous('Threshold', breaks = 1:6, labels = str_c(letters[1:6], '|', letters[2:7]))


3 Likes