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
library(tidyverse)
library(brms)
library(tidybayes)
library(psych)
#get some data
set.seed(1)
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
summary<-summary(fit1)
#check the class of the estimate
class(summary$fixed$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