You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(See #1318.) For ordinal models in brms, posterior_predict (called by type = "prediction" in marginaleffects) averages over the levels of the response variable, but posterior_epredict (called by type = "response" in marginaleffects) does not. In the latter, we get a probability for each response level, which are called Group in marginaleffects. In the below code, marginaleffects generates nice column names for the former but not the latter. For the latter, I suggest concatenating the Group number to the remaining factor levels to make nice column names.
data <- mtcars
mdl <-
brm(
carb ~ cyl,
data = data,
family = cumulative("probit")
)
mdl
avg_predictions(
mdl,
by = "cyl",
type = "prediction"
) |>
print() |>
get_draws("DxP") |>
head()
avg_predictions(
mdl,
by = "cyl",
type = "response"
) |>
print() |>
get_draws("DxP") |>
head()
The text was updated successfully, but these errors were encountered:
andymilne
changed the title
Nice get_draws(shape = DxP) column names break when response is multivariate
Nice get_draws(shape = "DxP") column names break when response is multivariate
Jan 15, 2025
(See #1318.) For ordinal models in
brms
,posterior_predict
(called bytype = "prediction"
inmarginaleffects
) averages over the levels of the response variable, butposterior_epredict
(called bytype = "response"
inmarginaleffects
) does not. In the latter, we get a probability for each response level, which are calledGroup
inmarginaleffects
. In the below code,marginaleffects
generates nice column names for the former but not the latter. For the latter, I suggest concatenating theGroup
number to the remaining factor levels to make nice column names.The text was updated successfully, but these errors were encountered: