Open vincentarelbundock opened 2 weeks ago
The find_variables() function does not return predictors in the distributional component of a brms model. As a result, get_data() is missing some columns. In this example, the cyl variable should be included but is missing.
find_variables()
brms
get_data()
cyl
library(brms) library(insight) data("mtcars") mdl <- brm( bf(carb ~ gear * vs) + lf(disc ~ 0 + mo(cyl)), data = mtcars, family = cumulative("probit"), prior = set_prior("normal(0, 1)", class = "b") + set_prior("normal(0, 1)", dpar = "disc"), ) find_variables(mdl) > $response > [1] "carb" > > $conditional > [1] "gear" "vs" get_data(mdl) |> head() > carb gear vs > Mazda RX4 4 4 0 > Mazda RX4 Wag 4 4 0 > Datsun 710 1 4 1 > Hornet 4 Drive 1 3 1 > Hornet Sportabout 2 3 0 > Valiant 1 3 1
brms is too flexible... 😞 But I have an idea how to fix this.
The
find_variables()
function does not return predictors in the distributional component of abrms
model. As a result,get_data()
is missing some columns. In this example, thecyl
variable should be included but is missing.