Strange class output in brms model

I am having trouble running a model that worked fine a few months ago. This is a model from Solomon Kurz blog ( Notes on the Bayesian cumulative probit)

When I look at the Estimate of the model, it has started to return it with class '[1] “pillar_num” “pillar_vctr” “vctrs_vctr”
[4] “double” ’
I really have no idea what is going on, and why this is happening, it used to return it as numeric.

#load the packages

#get some data

d <- psych::bfi %>% 
  mutate(male = ifelse(gender == 1, 1, 0),
         female = ifelse(gender == 2, 1, 0)) %>% 
  drop_na() %>% 
  slice_sample(n = 200) %>% 
  mutate(id = 1:n()) %>% 
  select(id, male, female, N1:N5) %>% 
  pivot_longer(N1:N5, names_to = "item", values_to = "rating")

#run the model
fit1 <- brm(
  data = d,
  family = cumulative(probit),
  rating ~ 1,
  prior = c(prior(normal(-0.97, 1), class = Intercept, coef = 1),
            prior(normal(-0.43, 1), class = Intercept, coef = 2),
            prior(normal( 0.00, 1), class = Intercept, coef = 3),
            prior(normal( 0.43, 1), class = Intercept, coef = 4),
            prior(normal( 0.97, 1), class = Intercept, coef = 5)),
  cores = 4,
  seed = 1,
  init_r = 0.2

#summarise the model

#check the class of the estimate
#[1] "pillar_num"  "pillar_vctr" "vctrs_vctr" 
#[4] "double" 

I’m sure this was not the class of the estimate when I last ran this, have I got it wrong? I need it to be a normal number format so I can pull it into the write up of my results.

Many thanks

What version(s) of brms are you using?


1 Like

@GabriellaS-K, it looked like you made some progress on social media. Is this resolved, or do you still need help?

It isn’t resolved but my work around is reclassifying each estimate individually as.numeric which gets it to a format I can work with! However not everyone has been able to reproduce my error, which suggests that it’s a package/update issue, though everything is the latest version, I checked and updated where appropriate.

TLDR I don’t need help anymore but the issue is still an issue

1 Like