Skip to contents

Use category_groups to group categories together. The function asks the user to choose how to group the categories together, in order to aid interpretation with many category models (e.g. ordinal or multinomial models). The function returns the average marginal effect for each category, across levels of xvar, all other variables observed.

Usage

posterior_pme(
  model = burn_flag,
  xvar = "prepost",
  mvar = "presvote_trump_2020",
  mrange = c(0, 1),
  xrange = c("pre", "post")
)

Arguments

model

brms model

xvar

independent variable

mvar

moderator variable

mrange

values of mvar

xrange

values of xvar

Value

R data frame with posterior predictions for each category, across levels of xvar, all other variables held at mean.