This page post-processes the models defined on the Models page. See the Estimands page for formal definitions of each quantity and the Deviations page for how this differs from the preregistration.

Load models

The models are fit on the Models page and saved in output/. Here we just load them.

Code
model_conjoint <- readRDS(here("output", "model_conjoint_bernoulli.rds"))
model_h5 <- readRDS(here("output", "model_h5.rds"))
model_e3 <- readRDS(here("output", "model_e3.rds"))

# The models were fit with inline data expressions like
# `drop_na(conjoint, all_of(moderators_h5))`, which marginaleffects/insight
# can't reliably recover from this page's environment. Attach the exact
# training data explicitly so datagrid() and avg_*() never have to guess.
model_conjoint <- set_modeldata(model_conjoint, conjoint)
model_h5 <- set_modeldata(model_h5, drop_na(conjoint, all_of(moderators_h5)))
model_e3 <- set_modeldata(model_e3, drop_na(conjoint, all_of(moderators_e3)))
Code
# Subgroup labels with respondent counts, like "Liberal (n=507)". Counts come
# from the data each model was actually fit on (after listwise deletion), so
# they can be slightly smaller than the full-sample counts
subgroup_lookup <- moderators |>
  mutate(counts = map2(moderator, family, \(x, fam) {
    model_data <- if (fam == "H5") model_h5$data else model_e3$data

    # (select() + count() instead of count(.data[[x]]), since .data[[x]] inside
    # a nested mutate() fails with "object 'x' not found")
    model_data |>
      distinct(id, .keep_all = TRUE) |>
      select(subgroup = all_of(x)) |>
      count(subgroup) |>
      mutate(subgroup = as.character(subgroup))
  })) |>
  unnest(counts) |>
  mutate(subgroup_label = fct_inorder(str_glue("{subgroup} (n={n})"))) |>
  select(moderator, subgroup, subgroup_label)
Code
# Reference level for each attribute (the first factor level)
reference_levels <- attribute_levels_lookup |>
  slice(1, .by = attribute) |>
  select(attribute, ref_level = level)

# Subgroup order within each moderator; the first subgroup is the comparison
# baseline for differences (e.g., "Rarely/never", "18–29", "Liberal")
subgroup_order <- subgroup_lookup |>
  mutate(subgroup_rank = row_number(), .by = moderator) |>
  select(moderator, subgroup, subgroup_rank)

# Conditional MMs → conditional AMCEs → differences in conditional AMCEs
# between subgroups, all within each posterior draw. The MMs for every level
# average over the same grid (H5) or the same randomized profiles (E3), so each
# AMCE is just MM(level) − MM(reference level). (For H5 this matches
# avg_comparisons() exactly.)
build_subgroup_effects <- function(mms_draws) {
  mms <- mms_draws |>
    mutate(drawid = as.character(drawid)) |>
    left_join(reference_levels, by = join_by(attribute)) |>
    left_join(subgroup_order, by = join_by(moderator, subgroup))

  amces <- mms |>
    mutate(
      draw = draw - draw[level == ref_level],
      .by = c(moderator, attribute, subgroup, drawid)
    ) |>
    filter(level != ref_level)

  diffs <- amces |>
    mutate(
      ref_subgroup = subgroup[subgroup_rank == 1],
      draw = draw - draw[subgroup_rank == 1],
      .by = c(moderator, attribute, level, drawid)
    ) |>
    filter(subgroup_rank != 1) |>
    mutate(comparison = str_glue("{subgroup} − {ref_subgroup}"))

  add_labels <- function(df) {
    df |>
      left_join(attribute_levels_lookup, by = join_by(attribute, level)) |>
      left_join(subgroup_lookup, by = join_by(moderator, subgroup)) |>
      left_join(moderators, by = join_by(moderator))
  }

  list(
    mms = add_labels(mms),
    amces = add_labels(amces),
    diffs = add_labels(diffs) |> mutate(comparison = fct_inorder(comparison))
  )
}

# Shared pieces for the side-by-side MM | AMCE | difference plots. Every panel
# uses the same rows (attribute levels, with the reference level on top), so
# you can read across a row: the MMs for that level, its AMCE relative to the
# reference level, and how much that AMCE differs between subgroups
facet_attributes <- facet_grid(
  rows = vars(attribute_nice),
  scales = "free_y",
  space = "free_y",
  labeller = labeller(attribute_nice = label_wrap_gen(12))
)

# Reference levels get a hollow point at 0 in the AMCE and difference panels.
# This layer goes first and includes *every* level of each attribute (x is NA
# for the non-reference ones), since ggplot builds each discrete y axis from
# the levels in the order the layers see them, dropping unused levels. If this
# layer only had the reference level, the rows would be misaligned with the
# marginal means panel
reference_points <- function(df) {
  geom_point(
    data = attribute_levels_lookup |>
      filter(attribute %in% unique(df$attribute)) |>
      left_join(reference_levels, by = join_by(attribute)) |>
      mutate(x = if_else(level == ref_level, 0, NA_real_)),
    aes(x = x, y = fct_rev(level_nice)),
    inherit.aes = FALSE,
    shape = 1,
    na.rm = TRUE
  )
}

hide_y <- theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())
hide_strips <- theme(strip.text.y = element_blank())
# (Groups are reversed in the plots so the dodged order matches the legend)
dodge <- position_dodge(width = 0.8)

# Conditional MMs | conditional AMCEs | differences in AMCEs for one moderator
plot_subgroup_effects <- function(effects, mod, atts = c("rbi", "ubi")) {
  mms <- filter(effects$mms, moderator == mod, attribute %in% atts)
  amces <- filter(effects$amces, moderator == mod, attribute %in% atts)
  diffs <- filter(effects$diffs, moderator == mod, attribute %in% atts)

  p_mms <- ggplot(mms, aes(x = draw, y = fct_rev(level_nice), fill = subgroup_label, group = fct_rev(subgroup_label))) +
    geom_vline(xintercept = baseline_rate, linetype = "dashed", linewidth = 0.25) +
    stat_halfeye(normalize = "groups", position = dodge) +
    scale_x_continuous(labels = label_percent()) +
    facet_attributes +
    labs(
      x = "Probability of choosing\nthe profile", y = NULL, fill = NULL,
      title = "Marginal means"
    ) +
    hide_strips

  p_amces <- ggplot(amces, aes(x = draw, y = fct_rev(level_nice), fill = subgroup_label, group = fct_rev(subgroup_label))) +
    reference_points(amces) +
    geom_vline(xintercept = 0, linewidth = 0.25) +
    stat_halfeye(normalize = "groups", position = dodge) +
    scale_x_continuous(labels = label_pp) +
    facet_attributes +
    labs(
      x = "Percentage point change\nvs. reference level", y = NULL, fill = NULL,
      title = "AMCEs"
    ) +
    hide_y + hide_strips

  p_diffs <- ggplot(diffs, aes(x = draw, y = fct_rev(level_nice), fill = comparison, group = fct_rev(comparison))) +
    reference_points(diffs) +
    geom_vline(xintercept = 0, linewidth = 0.25) +
    stat_halfeye(normalize = "groups", position = dodge) +
    scale_x_continuous(labels = label_pp) +
    scale_fill_grey(start = 0.4, end = 0.8) +
    facet_attributes +
    labs(
      x = "Difference in AMCEs\n(percentage points)", y = NULL, fill = NULL,
      title = "Difference in AMCEs"
    ) +
    hide_y +
    theme(strip.text.y = element_text(angle = 0))

  (p_mms | p_amces | p_diffs) +
    plot_layout(guides = "collect") +
    plot_annotation(title = unique(mms$moderator_nice)) &
    theme(legend.position = "bottom", legend.direction = "vertical")
}

Reference grids

The estimands are population averages (see Estimands), but we compute them with respondent intercepts set to 0 (re_formula = NA) over a balanced grid of every possible profile (3 × 3 × 4 × 4 × 2 = 288 profiles), since σ for the respondent intercepts is ≈ 0.02 and the two versions are practically identical (checked below). Averaging over that grid gives every attribute level equal weight, which matches the uniform marginal distribution of each attribute in the design. (Profiles within a task aren’t drawn independently, since 61% of tasks show three distinct rbi levels, which suggests a balanced-overlap design. But each level’s marginal frequency is uniform, and a profile-level Bernoulli model doesn’t use the within-task competitor distribution.)

It’s also much cheaper. Predicting on the observed data means a 36,030-row × 4,000-draw matrix (~1.15 GB) for every call; the grid is 288 × 4,000.

The grid is balanced over the five attributes only. Respondent moderators are never put on a balanced grid, since every combination of giving × volunteering × work history (etc.) getting equal weight matches no real population. Instead, they enter at their observed joint distribution (see the H5 and E3 sections).

NoteWhy datagrid() with the default grid_type?

With the default grid_type = "mean_or_mode", every variable we set to unique gets all its levels (crossed), and everything else in the model gets held at its mean or mode. In model_conjoint the only other variable is id, which gets set to its “mode” (an arbitrary respondent, since everyone has 30 rows). That’s irrelevant with re_formula = NA, but it means these grids should never be used with re_formula = NULL; that would give predictions for one specific respondent.

The other grid types don’t work here:

  • grid_type = "balanced" sets all factor and character columns to unique, including id (and the binary response), giving 288 × 1,201 × 2 = 691,776 rows.
  • grid_type = "counterfactual" duplicates the full dataset for each combination of the listed values (36,030 × 288 ≈ 10.4 million rows).
Code
# Set each attribute to `unique` (i.e. all its levels) → all 288 profiles.
# `extra` takes additional datagrid() arguments, like list(giving = unique).
# (do.call() rather than rlang::inject(!!!) because inject() inside mutate()
# gets its !!! processed too early by dplyr)
make_grid <- function(model, extra = list()) {
  grid_args <- conjoint_attributes |>
    set_names() |>
    map(\(x) unique)

  do.call(datagrid, c(list(model = model), grid_args, extra))
}

grid_main <- make_grid(model_conjoint)
## Loading required namespace: rstan
nrow(grid_main)
## [1] 288

Overall results

Marginal means

Code
mms_main <- attribute_lookup |>
  mutate(
    mms = map(attribute, \(att) {
      avg_predictions(
        model_conjoint,
        newdata = grid_main,
        by = att,
        re_formula = NA
      )
    })
  )

# Long data frame of posterior draws for every attribute level
mms_main_draws <- mms_main |>
  mutate(
    draws = map2(mms, attribute, \(x, att) {
      # avg_predictions() names the `by` column after the attribute (rbi, ubi,
      # etc.), so rename it to something consistent before combining
      get_draws(x) |>
        rename(level = all_of(att))
    })
  ) |>
  select(-mms) |>
  unnest(draws) |>
  left_join(
    attribute_levels_lookup,
    by = join_by(attribute, attribute_nice, level)
  )
Code
mms_main_draws |>
  group_by(attribute_nice, level_nice) |>
  median_qi(draw) |>
  select(Attribute = attribute_nice, Level = level_nice, MM = draw, .lower, .upper) |>
  knitr::kable(digits = 3)
Table 1: Marginal means (posterior medians and 95% credible intervals)
Attribute Level MM .lower .upper
Core service price (RBI) Free 0.434 0.425 0.443
Core service price (RBI) Reduced price 0.296 0.288 0.304
Core service price (RBI) Full price 0.175 0.168 0.182
Side business (UBI) None 0.326 0.318 0.334
Side business (UBI) Event space rental 0.304 0.296 0.312
Side business (UBI) Running a pizza shop 0.276 0.268 0.283
Nonprofit type Community arts center 0.240 0.231 0.249
Nonprofit type Student tutoring center 0.304 0.294 0.313
Nonprofit type Urban forestry center 0.261 0.253 0.270
Nonprofit type Mental health center 0.402 0.393 0.412
Use of donations Paying program staff 0.338 0.329 0.348
Use of donations Capacity building 0.311 0.302 0.321
Use of donations Rainy day funds 0.275 0.266 0.284
Use of donations Unrestricted use 0.282 0.273 0.291
Financial situation In good condition 0.269 0.263 0.276
Financial situation Under financial stress 0.334 0.328 0.341

AMCEs

Code
amces_main <- avg_comparisons(
  model_conjoint,
  variables = conjoint_attributes,
  newdata = grid_main,
  re_formula = NA
)

amces_main_draws <- get_draws(amces_main) |>
  separate_wider_delim(contrast, delim = " - ", names = c("level", "ref")) |>
  rename(attribute = term)
Code
amces_main_draws |>
  left_join(attribute_levels_lookup, by = join_by(attribute, level)) |>
  group_by(attribute_nice, level_nice, ref) |>
  summarize(
    AMCE = median(draw),
    .lower = quantile(draw, 0.025),
    .upper = quantile(draw, 0.975),
    `P(> 0)` = mean(draw > 0),
    .groups = "drop"
  ) |>
  rename(Attribute = attribute_nice, Level = level_nice, Reference = ref) |>
  knitr::kable(digits = 3)
Table 2: AMCEs (posterior medians, 95% credible intervals, and probability of direction)
Attribute Level Reference AMCE .lower .upper P(> 0)
Core service price (RBI) Reduced price Free -0.138 -0.150 -0.126 0
Core service price (RBI) Full price Free -0.259 -0.270 -0.248 0
Side business (UBI) Event space rental None -0.021 -0.033 -0.011 0
Side business (UBI) Running a pizza shop None -0.050 -0.061 -0.039 0
Nonprofit type Student tutoring center Community arts center 0.064 0.051 0.076 1
Nonprofit type Urban forestry center Community arts center 0.022 0.009 0.034 1
Nonprofit type Mental health center Community arts center 0.162 0.149 0.175 1
Use of donations Capacity building Paying program staff -0.027 -0.040 -0.014 0
Use of donations Rainy day funds Paying program staff -0.063 -0.076 -0.050 0
Use of donations Unrestricted use Paying program staff -0.056 -0.069 -0.043 0
Financial situation Under financial stress In good condition 0.065 0.056 0.075 1

Marginal means and AMCEs together

Figure 1 shows the MMs and AMCEs side by side. Each row is the same attribute level in both panels, so the AMCE for a level is the gap between its MM and the reference level’s MM (the hollow point at 0).

Code
amces_main_plot <- amces_main_draws |>
  left_join(attribute_levels_lookup, by = join_by(attribute, level))

p_mms <- ggplot(mms_main_draws, aes(x = draw, y = fct_rev(level_nice), fill = attribute_nice)) +
  geom_vline(xintercept = baseline_rate, linetype = "dashed", linewidth = 0.25) +
  stat_halfeye(normalize = "groups") +
  guides(fill = "none") +
  scale_x_continuous(labels = label_percent()) +
  facet_attributes +
  labs(x = "Probability of choosing the profile", y = NULL, title = "Marginal means") +
  hide_strips

p_amces <- ggplot(amces_main_plot, aes(x = draw, y = fct_rev(level_nice), fill = attribute_nice)) +
  reference_points(amces_main_plot) +
  geom_vline(xintercept = 0, linewidth = 0.25) +
  stat_halfeye(normalize = "groups") +
  guides(fill = "none") +
  scale_x_continuous(labels = label_pp) +
  facet_attributes +
  labs(x = "Percentage point change vs. reference level", y = NULL, title = "AMCEs") +
  hide_y +
  theme(strip.text.y = element_text(angle = 0))

p_mms | p_amces
Figure 1: Posterior marginal means and AMCEs for all attributes. The dashed line is the overall share of profiles chosen; hollow points mark each attribute’s reference level.

H5: Nonprofit experience

H5a/b: The negative effect of RBI [UBI] is attenuated among donors with more nonprofit experience (donating, volunteering, working in nonprofits, or making large prior donations).

For each of the four experience indicators, the primary H5 estimands are:

  1. The conditional AMCEs of RBI (reduced price − free, full price − free) and UBI (event space rental − none, pizza shop − none) among the more- and less-experienced groups
  2. Their difference (more − less experienced)
  3. The posterior probability that the difference is positive. The RBI and UBI AMCEs are negative, so attenuation means the AMCE is less negative among the more experienced, and P(difference > 0) is the posterior probability of H5.

“More experience” means giving often/occasionally, volunteering often/occasionally, having worked at a nonprofit, and having given $200+ in the past year.

These are unadjusted subgroup quantities. The AMCE among frequent givers averages over the observed mix of volunteering, nonprofit work, and $200+ giving among frequent givers, not over a balanced grid of the other moderators. To get that from the joint model, we predict on the 288-profile attribute grid × every observed combination of the four indicators, and weight each combination by its number of respondents (wts = "n_resp"). With by = moderator, {marginaleffects} computes weighted averages within each level of the moderator, so each level gets the observed distribution of the other three indicators within that level.

ImportantReference categories

Leeper, Hobolt, and Tilley (2020) show that differences in conditional AMCEs depend on the reference category: they mix how subgroups differ on the level of interest with how they differ on the reference level. Here the reference levels (free, no side business) are exactly what H5 is about (“the negative effect of RBI” is the effect of charging relative to not charging), so the AMCE difference is the right estimand. But we also report the companion conditional MMs so readers can see whether a difference comes from the RBI levels or from the free baseline.

The moderators aren’t randomized, so these differences are descriptive, not causal.

Code
# Observed combinations of the four experience indicators, with the number of
# respondents in each (≤ 2^4 = 16 combinations)
h5_combos <- model_h5$data |>
  distinct(id, across(all_of(moderators_h5))) |>
  count(across(all_of(moderators_h5)), name = "n_resp")

# 288 attribute profiles × each observed combination. datagrid() also adds the
# moderators at their modes, so drop those before crossing in the combinations
grid_h5 <- make_grid(model_h5) |>
  select(-any_of(c("rowid", moderators_h5))) |>
  cross_join(h5_combos)

nrow(grid_h5)
## [1] 4320
Code
knitr::kable(h5_combos)
Table 3: Observed combinations of the four experience indicators (respondents in model_h5)
giving volunteering npo_work gave_200 n_resp
Rarely/never Rarely/never Never worked at a nonprofit Under $200 334
Rarely/never Rarely/never Never worked at a nonprofit Gave $200+ 16
Rarely/never Rarely/never Has worked at a nonprofit Under $200 97
Rarely/never Rarely/never Has worked at a nonprofit Gave $200+ 5
Rarely/never Often/occasionally Never worked at a nonprofit Under $200 24
Rarely/never Often/occasionally Never worked at a nonprofit Gave $200+ 3
Rarely/never Often/occasionally Has worked at a nonprofit Under $200 24
Often/occasionally Rarely/never Never worked at a nonprofit Under $200 181
Often/occasionally Rarely/never Never worked at a nonprofit Gave $200+ 96
Often/occasionally Rarely/never Has worked at a nonprofit Under $200 70
Often/occasionally Rarely/never Has worked at a nonprofit Gave $200+ 51
Often/occasionally Often/occasionally Never worked at a nonprofit Under $200 53
Often/occasionally Often/occasionally Never worked at a nonprofit Gave $200+ 70
Often/occasionally Often/occasionally Has worked at a nonprofit Under $200 87
Often/occasionally Often/occasionally Has worked at a nonprofit Gave $200+ 74

H5a/H5b: Conditional AMCEs and differences

Code
h5_amces <- tibble(moderator = moderators_h5) |>
  mutate(
    # Conditional AMCEs of RBI and UBI within each level of the moderator
    amces = map(moderator, \(mod) {
      avg_comparisons(
        model_h5,
        variables = c("rbi", "ubi"),
        by = mod,
        newdata = grid_h5,
        wts = "n_resp",
        re_formula = NA
      )
    }),
    # Difference in conditional AMCEs: more − less experienced. The less
    # experienced group is each moderator's first (reference) level
    diffs = map(moderator, \(mod) {
      avg_comparisons(
        model_h5,
        variables = c("rbi", "ubi"),
        by = mod,
        newdata = grid_h5,
        wts = "n_resp",
        re_formula = NA,
        hypothesis = difference ~ reference | term + contrast
      )
    })
  )

h5_amces_draws <- h5_amces |>
  mutate(draws = map2(amces, moderator, \(x, mod) {
    get_draws(x) |>
      rename(subgroup = all_of(mod)) |>
      mutate(subgroup = as.character(subgroup))
  })) |>
  select(moderator, draws) |>
  unnest(draws) |>
  mutate(
    experience = if_else(
      subgroup == h5_more_experienced[moderator],
      "More experienced",
      "Less experienced"
    )
  ) |>
  left_join(moderators, by = join_by(moderator)) |>
  left_join(h5_contrasts, by = join_by(term, contrast))

h5_diffs_draws <- h5_amces |>
  mutate(draws = map(diffs, get_draws)) |>
  select(moderator, draws) |>
  unnest(draws) |>
  left_join(moderators, by = join_by(moderator)) |>
  left_join(h5_contrasts, by = join_by(term, contrast))
Code
# Format a vector of draws as "median [2.5%, 97.5%]" in percentage points
label_pp_precise <- label_number(
  accuracy = 0.1, scale = 100, suffix = " pp.", style_negative = "minus"
)

fmt_ci <- function(x) {
  as.character(str_glue(
    "{label_pp_precise(median(x))} ",
    "[{label_pp_precise(quantile(x, 0.025))}, {label_pp_precise(quantile(x, 0.975))}]"
  ))
}

h5_amces_summary <- h5_amces_draws |>
  summarize(amce = fmt_ci(draw), .by = c(moderator_nice, contrast_nice, experience)) |>
  pivot_wider(names_from = experience, values_from = amce)

h5_diffs_summary <- h5_diffs_draws |>
  summarize(
    `Difference (more − less)` = fmt_ci(draw),
    `P(diff > 0)` = mean(draw > 0),
    .by = c(moderator_nice, contrast_nice)
  )

h5_amces_summary |>
  left_join(h5_diffs_summary, by = join_by(moderator_nice, contrast_nice)) |>
  arrange(contrast_nice, moderator_nice) |>
  select(
    Contrast = contrast_nice, Moderator = moderator_nice,
    `Less experienced`, `More experienced`, everything()
  ) |>
  knitr::kable(digits = 3)
Table 4: H5a/H5b: Conditional AMCEs among less and more experienced respondents, their difference (more − less), and the posterior probability that the difference is positive (i.e., that the effect is attenuated). Posterior medians with 95% credible intervals.
Contrast Moderator Less experienced More experienced Difference (more − less) P(diff > 0)
H5a: Reduced price − Free Giving frequency −14.4 pp. [−16.2 pp., −12.6 pp.] −13.3 pp. [−14.8 pp., −11.7 pp.] 1.1 pp. [−1.2 pp., 3.5 pp.] 0.816
H5a: Reduced price − Free Volunteering −14.5 pp. [−16.0 pp., −13.1 pp.] −11.7 pp. [−14.0 pp., −9.5 pp.] 2.8 pp. [0.1 pp., 5.5 pp.] 0.978
H5a: Reduced price − Free Nonprofit work −13.5 pp. [−15.0 pp., −12.1 pp.] −14.1 pp. [−16.2 pp., −11.9 pp.] −0.6 pp. [−3.2 pp., 2.0 pp.] 0.323
H5a: Reduced price − Free Gave $200+ −13.9 pp. [−15.3 pp., −12.5 pp.] −13.3 pp. [−15.6 pp., −10.9 pp.] 0.7 pp. [−2.1 pp., 3.4 pp.] 0.688
H5a: Full price − Free Giving frequency −26.8 pp. [−28.4 pp., −25.0 pp.] −25.4 pp. [−26.9 pp., −24.0 pp.] 1.3 pp. [−0.9 pp., 3.5 pp.] 0.869
H5a: Full price − Free Volunteering −27.4 pp. [−28.7 pp., −26.1 pp.] −22.3 pp. [−24.5 pp., −20.2 pp.] 5.1 pp. [2.5 pp., 7.6 pp.] 1.000
H5a: Full price − Free Nonprofit work −26.1 pp. [−27.5 pp., −24.7 pp.] −25.7 pp. [−27.7 pp., −23.8 pp.] 0.4 pp. [−2.0 pp., 2.8 pp.] 0.641
H5a: Full price − Free Gave $200+ −26.4 pp. [−27.7 pp., −25.1 pp.] −25.0 pp. [−27.2 pp., −22.8 pp.] 1.4 pp. [−1.2 pp., 3.9 pp.] 0.851
H5b: Event space rental − None Giving frequency −3.0 pp. [−4.7 pp., −1.4 pp.] −1.5 pp. [−2.9 pp., 0.1 pp.] 1.6 pp. [−0.7 pp., 3.9 pp.] 0.906
H5b: Event space rental − None Volunteering −2.0 pp. [−3.3 pp., −0.7 pp.] −2.3 pp. [−4.5 pp., −0.1 pp.] −0.3 pp. [−2.9 pp., 2.3 pp.] 0.422
H5b: Event space rental − None Nonprofit work −2.4 pp. [−3.8 pp., −1.0 pp.] −1.5 pp. [−3.4 pp., 0.4 pp.] 0.9 pp. [−1.4 pp., 3.1 pp.] 0.763
H5b: Event space rental − None Gave $200+ −2.0 pp. [−3.3 pp., −0.6 pp.] −2.4 pp. [−4.6 pp., −0.4 pp.] −0.4 pp. [−3.0 pp., 2.0 pp.] 0.368
H5b: Running a pizza shop − None Giving frequency −5.1 pp. [−6.7 pp., −3.4 pp.] −4.8 pp. [−6.2 pp., −3.3 pp.] 0.3 pp. [−2.0 pp., 2.5 pp.] 0.612
H5b: Running a pizza shop − None Volunteering −5.0 pp. [−6.2 pp., −3.7 pp.] −4.7 pp. [−6.8 pp., −2.5 pp.] 0.3 pp. [−2.3 pp., 2.8 pp.] 0.582
H5b: Running a pizza shop − None Nonprofit work −4.8 pp. [−6.2 pp., −3.5 pp.] −5.0 pp. [−6.9 pp., −3.2 pp.] −0.2 pp. [−2.6 pp., 2.1 pp.] 0.437
H5b: Running a pizza shop − None Gave $200+ −4.7 pp. [−5.9 pp., −3.4 pp.] −5.5 pp. [−7.6 pp., −3.3 pp.] −0.8 pp. [−3.2 pp., 1.7 pp.] 0.256

Companion conditional marginal means

Code
# Conditional MMs for every attribute within each level of each H5 moderator,
# averaging over the observed combinations of the other three indicators
mms_h5 <- expand_grid(moderator = moderators_h5, attribute = conjoint_attributes) |>
  mutate(
    mms = map2(attribute, moderator, \(att, mod) {
      avg_predictions(
        model_h5,
        newdata = grid_h5,
        by = c(att, mod),
        wts = "n_resp",
        re_formula = NA
      )
    })
  )

mms_h5_draws <- mms_h5 |>
  mutate(
    draws = pmap(list(mms, attribute, moderator), \(x, att, mod) {
      get_draws(x) |>
        rename(level = all_of(att), subgroup = all_of(mod)) |>
        # Subgroup levels differ across moderators, so make them all character
        # before stacking (the order comes back from subgroup_lookup)
        mutate(subgroup = as.character(subgroup))
    })
  ) |>
  select(moderator, attribute, draws) |>
  unnest(draws) |>
  select(moderator, attribute, level, subgroup, drawid, draw)
Code
mms_h5_draws |>
  filter(attribute %in% c("rbi", "ubi")) |>
  mutate(
    experience = if_else(subgroup == h5_more_experienced[moderator], "more", "less")
  ) |>
  select(-subgroup) |>
  pivot_wider(names_from = experience, values_from = draw) |>
  mutate(diff = more - less) |>
  left_join(moderators, by = join_by(moderator)) |>
  left_join(attribute_levels_lookup, by = join_by(attribute, level)) |>
  summarize(
    `MM (less)` = median(less),
    `MM (more)` = median(more),
    `Difference` = fmt_ci(diff),
    `P(diff > 0)` = mean(diff > 0),
    .by = c(moderator_nice, attribute_nice, level_nice)
  ) |>
  rename(Moderator = moderator_nice, Attribute = attribute_nice, Level = level_nice) |>
  knitr::kable(digits = 3)
Table 5: Conditional MMs for RBI and UBI levels among less and more experienced respondents, and their difference (more − less)
Moderator Attribute Level MM (less) MM (more) Difference P(diff > 0)
Giving frequency Core service price (RBI) Free 0.431 0.437 0.6 pp. [−1.2 pp., 2.3 pp.] 0.750
Giving frequency Core service price (RBI) Reduced price 0.287 0.305 1.7 pp. [0.1 pp., 3.4 pp.] 0.980
Giving frequency Core service price (RBI) Full price 0.164 0.183 1.9 pp. [0.6 pp., 3.3 pp.] 0.998
Giving frequency Side business (UBI) None 0.321 0.329 0.8 pp. [−0.8 pp., 2.4 pp.] 0.830
Giving frequency Side business (UBI) Event space rental 0.291 0.314 2.3 pp. [0.8 pp., 4.0 pp.] 0.999
Giving frequency Side business (UBI) Running a pizza shop 0.270 0.281 1.1 pp. [−0.5 pp., 2.6 pp.] 0.918
Volunteering Core service price (RBI) Free 0.438 0.427 −1.1 pp. [−3.0 pp., 0.9 pp.] 0.139
Volunteering Core service price (RBI) Reduced price 0.292 0.310 1.8 pp. [−0.1 pp., 3.6 pp.] 0.968
Volunteering Core service price (RBI) Full price 0.163 0.203 4.0 pp. [2.5 pp., 5.6 pp.] 1.000
Volunteering Side business (UBI) None 0.321 0.337 1.6 pp. [−0.3 pp., 3.5 pp.] 0.953
Volunteering Side business (UBI) Event space rental 0.301 0.314 1.3 pp. [−0.5 pp., 3.1 pp.] 0.925
Volunteering Side business (UBI) Running a pizza shop 0.271 0.290 1.9 pp. [0.1 pp., 3.6 pp.] 0.981
Nonprofit work Core service price (RBI) Free 0.429 0.445 1.5 pp. [−0.3 pp., 3.4 pp.] 0.946
Nonprofit work Core service price (RBI) Reduced price 0.294 0.303 0.9 pp. [−0.8 pp., 2.7 pp.] 0.853
Nonprofit work Core service price (RBI) Full price 0.168 0.187 1.9 pp. [0.5 pp., 3.3 pp.] 0.996
Nonprofit work Side business (UBI) None 0.321 0.333 1.2 pp. [−0.4 pp., 2.9 pp.] 0.926
Nonprofit work Side business (UBI) Event space rental 0.297 0.318 2.1 pp. [0.5 pp., 3.7 pp.] 0.995
Nonprofit work Side business (UBI) Running a pizza shop 0.273 0.283 1.1 pp. [−0.6 pp., 2.6 pp.] 0.893
Gave $200+ Core service price (RBI) Free 0.436 0.432 −0.4 pp. [−2.4 pp., 1.6 pp.] 0.344
Gave $200+ Core service price (RBI) Reduced price 0.297 0.299 0.3 pp. [−1.6 pp., 2.0 pp.] 0.603
Gave $200+ Core service price (RBI) Full price 0.172 0.182 1.0 pp. [−0.6 pp., 2.6 pp.] 0.884
Gave $200+ Side business (UBI) None 0.324 0.331 0.7 pp. [−1.1 pp., 2.5 pp.] 0.776
Gave $200+ Side business (UBI) Event space rental 0.304 0.306 0.2 pp. [−1.6 pp., 2.0 pp.] 0.600
Gave $200+ Side business (UBI) Running a pizza shop 0.277 0.275 −0.1 pp. [−1.9 pp., 1.7 pp.] 0.443

H5 figures

Each figure below shows one experience indicator, with three panels that share the same rows:

  1. Marginal means: the probability of choosing a profile at each RBI/UBI level, for the less and more experienced groups
  2. AMCEs: each level’s MM minus the reference level’s MM (free; no side business), within each group
  3. Difference in AMCEs: more − less experienced. This is the H5 estimand; values above 0 mean the (negative) AMCE is smaller among the more experienced, as H5 predicts

Reading across a row connects the contrast back to the MMs it comes from: e.g., for volunteering, the full price AMCE is less negative among volunteers mostly because their MM at full price is higher (their MM at free is only slightly lower).

Code
effects_h5 <- build_subgroup_effects(mms_h5_draws)
Code
plot_subgroup_effects(effects_h5, "giving")
Figure 2: H5: Conditional MMs, AMCEs, and differences in AMCEs by giving frequency
Code
plot_subgroup_effects(effects_h5, "volunteering")
Figure 3: H5: Conditional MMs, AMCEs, and differences in AMCEs by volunteering frequency
Code
plot_subgroup_effects(effects_h5, "npo_work")
Figure 4: H5: Conditional MMs, AMCEs, and differences in AMCEs by nonprofit work experience
Code
plot_subgroup_effects(effects_h5, "gave_200")
Figure 5: H5: Conditional MMs, AMCEs, and differences in AMCEs by past-year giving ($200+)

Adjusted (Jensen-style) differences

As a secondary analysis, here’s the adjusted version: set everyone’s level of the moderator counterfactually (e.g., everyone gives often, then everyone gives rarely), hold the other three indicators at their observed values, and compare. This asks whether, say, giving frequency is associated with RBI sensitivity net of volunteering, nonprofit work, and large gifts.

Code
h5_adjusted <- tibble(moderator = moderators_h5) |>
  mutate(diffs = map(moderator, \(mod) {
    lvls <- levels(model_h5$data[[mod]])

    # Stack one copy of the grid per moderator level, with the moderator set
    # to that level for every row (the other indicators keep their observed
    # combinations and weights)
    grid_cf <- lvls |>
      map(\(l) {
        grid_h5 |>
          mutate(across(all_of(mod), \(x) factor(l, levels = lvls)))
      }) |>
      list_rbind()

    avg_comparisons(
      model_h5,
      variables = c("rbi", "ubi"),
      by = mod,
      newdata = grid_cf,
      wts = "n_resp",
      re_formula = NA,
      hypothesis = difference ~ reference | term + contrast
    )
  }))

h5_adjusted_draws <- h5_adjusted |>
  mutate(draws = map(diffs, get_draws)) |>
  select(moderator, draws) |>
  unnest(draws) |>
  left_join(moderators, by = join_by(moderator)) |>
  left_join(h5_contrasts, by = join_by(term, contrast))

bind_rows(
  h5_diffs_draws |> mutate(version = "Unadjusted"),
  h5_adjusted_draws |> mutate(version = "Adjusted")
) |>
  summarize(
    diff = fmt_ci(draw),
    p = mean(draw > 0),
    .by = c(contrast_nice, moderator_nice, version)
  ) |>
  pivot_wider(names_from = version, values_from = c(diff, p)) |>
  arrange(contrast_nice, moderator_nice) |>
  select(
    Contrast = contrast_nice, Moderator = moderator_nice,
    Unadjusted = diff_Unadjusted, `P(> 0), unadj.` = p_Unadjusted,
    Adjusted = diff_Adjusted, `P(> 0), adj.` = p_Adjusted
  ) |>
  knitr::kable(digits = 3)
Table 6: Unadjusted vs. adjusted differences in conditional AMCEs (more − less experienced)
Contrast Moderator Unadjusted P(> 0), unadj. Adjusted P(> 0), adj.
H5a: Reduced price − Free Giving frequency 1.1 pp. [−1.2 pp., 3.5 pp.] 0.816 0.4 pp. [−2.2 pp., 3.3 pp.] 0.618
H5a: Reduced price − Free Volunteering 2.8 pp. [0.1 pp., 5.5 pp.] 0.978 3.1 pp. [0.1 pp., 6.1 pp.] 0.979
H5a: Reduced price − Free Nonprofit work −0.6 pp. [−3.2 pp., 2.0 pp.] 0.323 −1.5 pp. [−4.1 pp., 1.2 pp.] 0.146
H5a: Reduced price − Free Gave $200+ 0.7 pp. [−2.1 pp., 3.4 pp.] 0.688 −0.2 pp. [−3.1 pp., 2.7 pp.] 0.447
H5a: Full price − Free Giving frequency 1.3 pp. [−0.9 pp., 3.5 pp.] 0.869 −0.4 pp. [−2.9 pp., 2.3 pp.] 0.392
H5a: Full price − Free Volunteering 5.1 pp. [2.5 pp., 7.6 pp.] 1.000 5.4 pp. [2.6 pp., 8.2 pp.] 1.000
H5a: Full price − Free Nonprofit work 0.4 pp. [−2.0 pp., 2.8 pp.] 0.641 −1.0 pp. [−3.5 pp., 1.5 pp.] 0.220
H5a: Full price − Free Gave $200+ 1.4 pp. [−1.2 pp., 3.9 pp.] 0.851 0.3 pp. [−2.5 pp., 3.1 pp.] 0.583
H5b: Event space rental − None Giving frequency 1.6 pp. [−0.7 pp., 3.9 pp.] 0.906 2.2 pp. [−0.4 pp., 5.0 pp.] 0.953
H5b: Event space rental − None Volunteering −0.3 pp. [−2.9 pp., 2.3 pp.] 0.422 −1.0 pp. [−4.0 pp., 1.8 pp.] 0.230
H5b: Event space rental − None Nonprofit work 0.9 pp. [−1.4 pp., 3.1 pp.] 0.763 0.9 pp. [−1.6 pp., 3.3 pp.] 0.752
H5b: Event space rental − None Gave $200+ −0.4 pp. [−3.0 pp., 2.0 pp.] 0.368 −1.3 pp. [−4.2 pp., 1.4 pp.] 0.175
H5b: Running a pizza shop − None Giving frequency 0.3 pp. [−2.0 pp., 2.5 pp.] 0.612 0.7 pp. [−1.9 pp., 3.3 pp.] 0.700
H5b: Running a pizza shop − None Volunteering 0.3 pp. [−2.3 pp., 2.8 pp.] 0.582 0.4 pp. [−2.5 pp., 3.2 pp.] 0.607
H5b: Running a pizza shop − None Nonprofit work −0.2 pp. [−2.6 pp., 2.1 pp.] 0.437 −0.3 pp. [−2.7 pp., 2.0 pp.] 0.394
H5b: Running a pizza shop − None Gave $200+ −0.8 pp. [−3.2 pp., 1.7 pp.] 0.256 −1.2 pp. [−3.9 pp., 1.6 pp.] 0.205

E3: Demographics

E3: Effects of RBI and UBI may vary by age, gender, education, income, marital status, political ideology, religiosity, and race.

The E3 quantities are the same unadjusted subgroup MMs and AMCEs, but we can’t use the H5 approach. The eight demographics have 646 observed combinations, so the attribute grid × combinations would be ~186,000 rows. That’s a ~6 GB prediction matrix with 4,000 draws, and avg_comparisons() would need several of them.

Instead, we predict once on the observed rows of the model data (33,840 rows, ~1.1 GB) with re_formula = NA, and average the draws within each attribute level × subgroup cell. This automatically uses the observed joint distribution of the other seven demographics within each subgroup. It also uses the observed distribution of the other attributes, which is uniform in expectation because of randomization rather than exactly uniform like the grid. Conditional AMCEs are then differences in these MMs within each posterior draw. Because the attributes are randomized, that’s the same estimand as the counterfactual contrast, up to tiny finite-sample imbalances in the profiles shown within each cell.

If 1.1 GB is too much, add ndraws = 1000 to the predictions() call.

Code
# One prediction for every observed row, for every posterior draw
preds_e3 <- predictions(model_e3, re_formula = NA)
# If memory is tight:
# preds_e3 <- predictions(model_e3, re_formula = NA, ndraws = 1000)

# Rows = observations, columns = posterior draws
preds_e3_matrix <- get_draws(preds_e3, shape = "PxD")
preds_e3_data <- as_tibble(preds_e3) |>
  select(all_of(c(conjoint_attributes, moderators_e3)))

# Average the prediction draws within each attribute level × subgroup cell.
# rowsum() adds up the rows within each cell, so dividing by the cell sizes
# gives cell means for every draw at once
cell_mean_draws <- function(att, mod) {
  cells <- interaction(
    preds_e3_data[[att]], preds_e3_data[[mod]],
    sep = "___", drop = TRUE, lex.order = TRUE
  )
  sums <- rowsum(preds_e3_matrix, cells)
  counts <- rowsum(rep(1, length(cells)), cells)

  (sums / as.vector(counts)) |>
    as_tibble(rownames = "cell") |>
    pivot_longer(-cell, names_to = "drawid", values_to = "draw") |>
    separate_wider_delim(cell, delim = "___", names = c("level", "subgroup"))
}

mms_e3_draws <- expand_grid(moderator = moderators_e3, attribute = conjoint_attributes) |>
  mutate(draws = map2(attribute, moderator, cell_mean_draws)) |>
  unnest(draws)

As a check, the cell means match avg_predictions() for one cell:

Code
check_e3 <- avg_predictions(model_e3, by = c("rbi", "ideology"), re_formula = NA)

mms_e3_draws |>
  filter(moderator == "ideology", attribute == "rbi") |>
  summarize(cell_means = median(draw), .by = c(level, subgroup)) |>
  left_join(
    as_tibble(check_e3) |>
      mutate(across(c(rbi, ideology), as.character)) |>
      select(level = rbi, subgroup = ideology, avg_predictions = estimate),
    by = join_by(level, subgroup)
  )
## # A tibble: 9 × 4
##   level         subgroup     cell_means avg_predictions
##   <chr>         <chr>             <dbl>           <dbl>
## 1 Free          Liberal           0.464           0.464
## 2 Free          Moderate          0.419           0.419
## 3 Free          Conservative      0.410           0.410
## 4 Reduced price Liberal           0.314           0.314
## 5 Reduced price Moderate          0.285           0.285
## 6 Reduced price Conservative      0.280           0.280
## 7 Full price    Liberal           0.165           0.165
## 8 Full price    Moderate          0.176           0.176
## 9 Full price    Conservative      0.187           0.187

rm(check_e3)
Code
# Conditional AMCEs (each attribute level − reference level, within each
# subgroup and draw) and differences in conditional AMCEs (each subgroup − the
# moderator's first subgroup, within each level and draw)
effects_e3 <- build_subgroup_effects(mms_e3_draws)
Code
effects_e3$diffs |>
  filter(attribute %in% c("rbi", "ubi")) |>
  mutate(contrast = str_glue("{level} − {ref_level}")) |>
  summarize(
    Difference = fmt_ci(draw),
    `P(diff > 0)` = mean(draw > 0),
    .by = c(moderator_nice, contrast, comparison)
  ) |>
  rename(Moderator = moderator_nice, Contrast = contrast, Comparison = comparison) |>
  knitr::kable(digits = 3)
Table 7: E3: Differences in conditional AMCEs of RBI and UBI between demographic subgroups (each subgroup − reference subgroup)
Moderator Contrast Comparison Difference P(diff > 0)
Age Reduced price − Free 30–44 − 18–29 −0.9 pp. [−4.3 pp., 2.6 pp.] 0.317
Age Reduced price − Free 45–59 − 18–29 −0.6 pp. [−4.1 pp., 3.0 pp.] 0.363
Age Reduced price − Free 60+ − 18–29 −0.5 pp. [−4.2 pp., 3.3 pp.] 0.392
Age Full price − Free 30–44 − 18–29 −1.0 pp. [−4.3 pp., 2.4 pp.] 0.284
Age Full price − Free 45–59 − 18–29 −1.1 pp. [−4.3 pp., 2.4 pp.] 0.261
Age Full price − Free 60+ − 18–29 −1.7 pp. [−5.0 pp., 1.9 pp.] 0.168
Age Event space rental − None 30–44 − 18–29 −2.2 pp. [−5.5 pp., 1.2 pp.] 0.094
Age Event space rental − None 45–59 − 18–29 −0.8 pp. [−4.0 pp., 2.4 pp.] 0.316
Age Event space rental − None 60+ − 18–29 −2.2 pp. [−5.7 pp., 1.3 pp.] 0.104
Age Running a pizza shop − None 30–44 − 18–29 −0.5 pp. [−3.8 pp., 2.8 pp.] 0.393
Age Running a pizza shop − None 45–59 − 18–29 0.0 pp. [−3.3 pp., 3.4 pp.] 0.506
Age Running a pizza shop − None 60+ − 18–29 0.6 pp. [−2.8 pp., 4.1 pp.] 0.625
Gender Reduced price − Free Male − Female −3.2 pp. [−5.7 pp., −0.8 pp.] 0.006
Gender Full price − Free Male − Female 1.3 pp. [−1.1 pp., 3.6 pp.] 0.867
Gender Event space rental − None Male − Female −1.0 pp. [−3.4 pp., 1.3 pp.] 0.186
Gender Running a pizza shop − None Male − Female 0.4 pp. [−1.8 pp., 2.8 pp.] 0.649
Education Reduced price − Free Some college or associate − HS or less −3.7 pp. [−7.7 pp., 0.2 pp.] 0.030
Education Reduced price − Free Bachelor’s+ − HS or less −0.6 pp. [−4.2 pp., 3.2 pp.] 0.381
Education Full price − Free Some college or associate − HS or less −1.7 pp. [−5.3 pp., 1.9 pp.] 0.176
Education Full price − Free Bachelor’s+ − HS or less 2.3 pp. [−1.2 pp., 5.6 pp.] 0.908
Education Event space rental − None Some college or associate − HS or less 1.9 pp. [−1.7 pp., 5.6 pp.] 0.841
Education Event space rental − None Bachelor’s+ − HS or less 0.7 pp. [−2.7 pp., 4.2 pp.] 0.660
Education Running a pizza shop − None Some college or associate − HS or less −1.0 pp. [−4.7 pp., 2.8 pp.] 0.290
Education Running a pizza shop − None Bachelor’s+ − HS or less −1.0 pp. [−4.5 pp., 2.6 pp.] 0.286
Income Reduced price − Free $50–99k − <$50k −3.2 pp. [−5.9 pp., −0.4 pp.] 0.015
Income Reduced price − Free $100k+ − <$50k −2.5 pp. [−5.7 pp., 0.5 pp.] 0.050
Income Full price − Free $50–99k − <$50k −1.1 pp. [−3.6 pp., 1.5 pp.] 0.210
Income Full price − Free $100k+ − <$50k 2.0 pp. [−0.9 pp., 4.6 pp.] 0.909
Income Event space rental − None $50–99k − <$50k 0.1 pp. [−2.5 pp., 2.8 pp.] 0.545
Income Event space rental − None $100k+ − <$50k −0.5 pp. [−3.5 pp., 2.3 pp.] 0.356
Income Running a pizza shop − None $50–99k − <$50k −0.3 pp. [−3.0 pp., 2.3 pp.] 0.406
Income Running a pizza shop − None $100k+ − <$50k −0.1 pp. [−2.9 pp., 2.8 pp.] 0.470
Marital status Reduced price − Free Married/partnered − Not married 1.0 pp. [−1.4 pp., 3.4 pp.] 0.804
Marital status Full price − Free Married/partnered − Not married 3.1 pp. [0.8 pp., 5.2 pp.] 0.996
Marital status Event space rental − None Married/partnered − Not married −0.8 pp. [−3.1 pp., 1.5 pp.] 0.251
Marital status Running a pizza shop − None Married/partnered − Not married −3.1 pp. [−5.4 pp., −0.9 pp.] 0.005
Ideology Reduced price − Free Moderate − Liberal 1.6 pp. [−1.6 pp., 4.7 pp.] 0.833
Ideology Reduced price − Free Conservative − Liberal 2.0 pp. [−0.8 pp., 4.7 pp.] 0.920
Ideology Full price − Free Moderate − Liberal 5.5 pp. [2.6 pp., 8.4 pp.] 1.000
Ideology Full price − Free Conservative − Liberal 7.6 pp. [5.1 pp., 10.2 pp.] 1.000
Ideology Event space rental − None Moderate − Liberal −0.3 pp. [−3.2 pp., 2.7 pp.] 0.422
Ideology Event space rental − None Conservative − Liberal 1.8 pp. [−0.8 pp., 4.3 pp.] 0.908
Ideology Running a pizza shop − None Moderate − Liberal 1.1 pp. [−2.0 pp., 4.0 pp.] 0.763
Ideology Running a pizza shop − None Conservative − Liberal 2.7 pp. [0.1 pp., 5.3 pp.] 0.981
Religion Reduced price − Free Religious − Not religious 1.7 pp. [−0.7 pp., 4.2 pp.] 0.916
Religion Full price − Free Religious − Not religious 5.7 pp. [3.4 pp., 8.0 pp.] 1.000
Religion Event space rental − None Religious − Not religious −1.1 pp. [−3.4 pp., 1.1 pp.] 0.164
Religion Running a pizza shop − None Religious − Not religious −0.5 pp. [−2.8 pp., 1.7 pp.] 0.334
Race Reduced price − Free Non-White − White 0.5 pp. [−2.0 pp., 3.0 pp.] 0.667
Race Full price − Free Non-White − White 4.5 pp. [2.2 pp., 6.8 pp.] 1.000
Race Event space rental − None Non-White − White −1.6 pp. [−4.0 pp., 0.7 pp.] 0.088
Race Running a pizza shop − None Non-White − White −1.0 pp. [−3.4 pp., 1.4 pp.] 0.199

E3 figures

Same layout as the H5 figures: marginal means, AMCEs, and differences in AMCEs, with the rows lined up across panels. For moderators with more than two groups, the differences are each group minus the first group (e.g., each age group − 18–29; moderate and conservative − liberal).

Code
plot_subgroup_effects(effects_e3, "age_group")
Figure 6: E3: Conditional MMs, AMCEs, and differences in AMCEs by age
Code
plot_subgroup_effects(effects_e3, "gender")
Figure 7: E3: Conditional MMs, AMCEs, and differences in AMCEs by gender
Code
plot_subgroup_effects(effects_e3, "education")
Figure 8: E3: Conditional MMs, AMCEs, and differences in AMCEs by education
Code
plot_subgroup_effects(effects_e3, "income")
Figure 9: E3: Conditional MMs, AMCEs, and differences in AMCEs by household income
Code
plot_subgroup_effects(effects_e3, "marital")
Figure 10: E3: Conditional MMs, AMCEs, and differences in AMCEs by marital status
Code
plot_subgroup_effects(effects_e3, "ideology")
Figure 11: E3: Conditional MMs, AMCEs, and differences in AMCEs by political ideology
Code
plot_subgroup_effects(effects_e3, "religious")
Figure 12: E3: Conditional MMs, AMCEs, and differences in AMCEs by religious affiliation
Code
plot_subgroup_effects(effects_e3, "race")
Figure 13: E3: Conditional MMs, AMCEs, and differences in AMCEs by race

All attributes by subgroup

The same three-panel layout for all five attributes, for every moderator. The H5 indicators come from model_h5 (averaged over the attribute grid × observed combinations of the other indicators) and the E3 demographics come from model_e3 (averaged over the observed rows). These aren’t part of the preregistered hypotheses (which are only about RBI and UBI), but they show whether subgroup differences are specific to commercialization or show up across the board, which would suggest a general difference in choice behavior (like opting out; see below) rather than a reaction to RBI/UBI.

Code
moderators_h5 |>
  map(\(mod) plot_subgroup_effects(effects_h5, mod, atts = conjoint_attributes)) |>
  walk(print)

Code
moderators_e3 |>
  map(\(mod) plot_subgroup_effects(effects_e3, mod, atts = conjoint_attributes)) |>
  walk(print)

Opting out (“none”) by subgroup

The “none” option was dropped from the data, so every row is a real profile, but respondents chose “none” in some tasks, and that opt-out rate differs across subgroups. Because each subgroup’s MMs are probabilities of choosing a profile, a subgroup that opts out more will have lower MMs across the board, even if its relative preferences across attribute levels are identical. Differences in conditional MMs therefore mix attribute preferences with opt-out propensity. A uniform level shift in the MM differences for a moderator is likely an opt-out story, not an attribute story; differences that vary across levels of an attribute are the more interesting ones. (AMCEs are differences within a subgroup, so a pure level shift mostly cancels out of them, though not exactly on the probability scale.)

Here are the raw opt-out rates (share of tasks where none of the three profiles was chosen):

Code
# One row per respondent × task; "none" means no profile in the task was chosen
tasks_none <- conjoint |>
  summarize(
    chose_none = sum(response) == 0,
    .by = c(id, task, all_of(moderators$moderator))
  )

bind_rows(
  tibble(family = "", moderator_nice = "Everyone", subgroup = "All respondents",
         p_none = mean(tasks_none$chose_none), tasks = nrow(tasks_none)),
  moderators |>
    mutate(rates = map(moderator, \(x) {
      tasks_none |>
        select(subgroup = all_of(x), chose_none) |>
        drop_na(subgroup) |>
        summarize(p_none = mean(chose_none), tasks = n(), .by = subgroup) |>
        arrange(subgroup) |>
        mutate(subgroup = as.character(subgroup))
    })) |>
    unnest(rates) |>
    mutate(moderator_nice = as.character(moderator_nice))
) |>
  select(
    Family = family, Moderator = moderator_nice, Subgroup = subgroup,
    `P(none)` = p_none, Tasks = tasks
  ) |>
  knitr::kable(digits = 3)
Table 8: Share of tasks where the respondent chose “none”, by subgroup (raw data)
Family Moderator Subgroup P(none) Tasks
Everyone All respondents 0.094 12010
H5 Giving frequency Rarely/never 0.117 5060
H5 Giving frequency Often/occasionally 0.077 6920
H5 Volunteering Rarely/never 0.108 8590
H5 Volunteering Often/occasionally 0.060 3360
H5 Nonprofit work Never worked at a nonprofit 0.110 7840
H5 Nonprofit work Has worked at a nonprofit 0.065 4130
H5 Gave $200+ Under $200 0.096 8760
H5 Gave $200+ Gave $200+ 0.089 3210
E3 Age 18–29 0.074 2240
E3 Age 30–44 0.070 3340
E3 Age 45–59 0.115 3520
E3 Age 60+ 0.115 2820
E3 Gender Female 0.080 6070
E3 Gender Male 0.110 5850
E3 Education HS or less 0.110 1560
E3 Education Some college or associate 0.107 4010
E3 Education Bachelor’s+ 0.082 6360
E3 Income <$50k 0.114 4200
E3 Income $50–99k 0.080 4450
E3 Income $100k+ 0.089 3310
E3 Marital status Not married 0.098 5910
E3 Marital status Married/partnered 0.090 6070
E3 Ideology Liberal 0.057 5070
E3 Ideology Moderate 0.120 2550
E3 Ideology Conservative 0.122 3880
E3 Religion Not religious 0.091 5550
E3 Religion Religious 0.097 6440
E3 Race White 0.100 7540
E3 Race Non-White 0.086 4380

Check: re_formula = NA vs. NULL

Everything above sets the respondent intercepts to 0 (re_formula = NA). The population-averaged estimand strictly averages over respondents’ intercepts too: predict each observed row with its own respondent intercept (re_formula = NULL) and average those (see the Estimands page). This section checks that the shortcut doesn’t matter, for the main model only.

The two versions differ in two ways: (1) how they handle the respondent intercepts, and (2) the observed data uses the empirical distribution of attribute levels, which is only approximately uniform. With a logit link, the two can diverge when \(\sigma_0\) is large, but here \(\sigma_0\) is tiny (≈0.02 in an earlier fit), so they should be nearly identical.

WarningMemory

Each avg_predictions() call on the observed data builds a 36,030 × 4,000 matrix of predictions (~1.15 GB). If that’s a problem, add ndraws = 1000 (passed through to brms::posterior_epred()) to use a random subset of draws.

Code
# No newdata → use the data the model was fit on; re_formula = NULL → include
# each respondent's estimated intercept
mms_main_pop <- attribute_lookup |>
  mutate(
    mms = map(attribute, \(att) {
      avg_predictions(model_conjoint, by = att, re_formula = NULL)
      # If memory is tight:
      # avg_predictions(model_conjoint, by = att, re_formula = NULL, ndraws = 1000)
    })
  )

mms_main_pop_draws <- mms_main_pop |>
  mutate(
    draws = map2(mms, attribute, \(x, att) {
      get_draws(x) |>
        rename(level = all_of(att))
    })
  ) |>
  select(-mms) |>
  unnest(draws) |>
  left_join(
    attribute_levels_lookup,
    by = join_by(attribute, attribute_nice, level)
  )

# AMCEs as differences in these MMs, within each draw. Strictly, the
# counterfactual version is avg_comparisons(model_conjoint, variables = ...,
# re_formula = NULL), but that predicts 2 × (number of contrasts) copies of the
# full data (several GB per attribute). Because attributes are randomized, the
# difference in observed-data MMs is essentially the same thing.
amces_main_pop_draws <- mms_main_pop_draws |>
  group_by(attribute, drawid) |>
  mutate(draw = draw - first(draw, order_by = level_nice)) |>
  ungroup() |>
  filter(level_nice != first(level_nice, order_by = level_nice), .by = attribute)
Code
estimand_versions <- c(
  "Balanced grid, re_formula = NA",
  "Observed data, re_formula = NULL"
)

p_mms <- bind_rows(
  mms_main_draws |> mutate(version = estimand_versions[1]),
  mms_main_pop_draws |> mutate(version = estimand_versions[2])
) |>
  mutate(version = factor(version, levels = estimand_versions)) |>
  ggplot(aes(x = draw, y = level_nice, color = version)) +
  stat_pointinterval(position = position_dodge(width = 0.5)) +
  scale_x_continuous(labels = label_percent()) +
  labs(x = "Marginal mean", y = NULL, color = NULL, title = "Marginal means") +
  facet_wrap(vars(attribute_nice), scales = "free_y", ncol = 2) +
  theme(legend.position = "bottom")

p_amces <- bind_rows(
  amces_main_draws |>
    left_join(attribute_levels_lookup, by = join_by(attribute, level)) |>
    mutate(version = estimand_versions[1]),
  amces_main_pop_draws |> mutate(version = estimand_versions[2])
) |>
  mutate(version = factor(version, levels = estimand_versions)) |>
  ggplot(aes(x = draw, y = level_nice, color = version)) +
  geom_vline(xintercept = 0) +
  stat_pointinterval(position = position_dodge(width = 0.5)) +
  scale_x_continuous(labels = label_pp) +
  labs(x = "AMCE", y = NULL, color = NULL, title = "AMCEs") +
  facet_wrap(vars(attribute_nice), scales = "free_y", ncol = 2) +
  theme(legend.position = "bottom")

p_mms
p_amces
Figure 14: Marginal means and AMCEs computed with intercepts at 0 over the balanced grid (re_formula = NA) and with each respondent’s intercept over the observed data (re_formula = NULL)
Figure 15: Marginal means and AMCEs computed with intercepts at 0 over the balanced grid (re_formula = NA) and with each respondent’s intercept over the observed data (re_formula = NULL)
Code
bind_rows(
  mms_main_draws |> mutate(version = "re_formula_NA"),
  mms_main_pop_draws |> mutate(version = "re_formula_NULL")
) |>
  group_by(attribute_nice, level_nice, version) |>
  summarize(estimate = median(draw), .groups = "drop") |>
  pivot_wider(names_from = version, values_from = estimate) |>
  mutate(difference = re_formula_NA - re_formula_NULL) |>
  select(
    Attribute = attribute_nice, Level = level_nice,
    `NA (grid)` = re_formula_NA, `NULL (observed)` = re_formula_NULL, difference
  ) |>
  knitr::kable(digits = 4)
Table 9: Posterior medians of the marginal means under each version, and their difference
Attribute Level NA (grid) NULL (observed) difference
Core service price (RBI) Free 0.4341 0.4342 0.0000
Core service price (RBI) Reduced price 0.2962 0.2966 -0.0004
Core service price (RBI) Full price 0.1751 0.1749 0.0002
Side business (UBI) None 0.3257 0.3262 -0.0005
Side business (UBI) Event space rental 0.3043 0.3038 0.0005
Side business (UBI) Running a pizza shop 0.2755 0.2758 -0.0003
Nonprofit type Community arts center 0.2400 0.2404 -0.0004
Nonprofit type Student tutoring center 0.3036 0.3028 0.0008
Nonprofit type Urban forestry center 0.2615 0.2614 0.0001
Nonprofit type Mental health center 0.4022 0.4026 -0.0004
Use of donations Paying program staff 0.3383 0.3378 0.0005
Use of donations Capacity building 0.3113 0.3129 -0.0016
Use of donations Rainy day funds 0.2754 0.2747 0.0007
Use of donations Unrestricted use 0.2823 0.2823 -0.0001
Financial situation In good condition 0.2692 0.2692 0.0000
Financial situation Under financial stress 0.3345 0.3346 -0.0002

A third version, integrating the random effects out over new simulated respondents (allow_new_levels = TRUE, sample_new_levels = "gaussian" with a grid of fake ids; see this post), isn’t worth it with \(\sigma_0\) this small, but it’s the one to use if we ever add random slopes.

Robustness: multinomial model

This compares the overall AMCEs from model_conjoint (Bernoulli) with the categorical (multinomial) version on the Models page, which mirrors the preregistered hierarchical multinomial logit (deviation #1). That model isn’t fit by default, so this section only runs if output/model_conjoint_categorical.rds exists.

Code
model_conjoint_categorical <- readRDS(here("output", "model_conjoint_categorical.rds"))

# P(profile chosen) = 1 − P(category 0, "not chosen"), over the same balanced
# 288-profile grid with intercepts at 0
preds_categorical <- model_conjoint_categorical |>
  epred_draws(newdata = grid_main, re_formula = NA) |>
  ungroup() |>
  filter(.category == "0") |>
  mutate(.epred = 1 - .epred)

# MMs for each attribute level, then AMCEs relative to the reference level
amces_categorical_draws <- attribute_lookup |>
  mutate(mms = map(attribute, \(att) {
    preds_categorical |>
      summarize(draw = mean(.epred), .by = c(all_of(att), .draw)) |>
      rename(level = all_of(att)) |>
      mutate(level = as.character(level))
  })) |>
  unnest(mms) |>
  left_join(
    attribute_levels_lookup,
    by = join_by(attribute, attribute_nice, level)
  ) |>
  mutate(draw = draw - first(draw, order_by = level_nice), .by = c(attribute, .draw)) |>
  filter(level_nice != first(level_nice, order_by = level_nice), .by = attribute)
Code
bind_rows(
  amces_main_draws |>
    left_join(attribute_levels_lookup, by = join_by(attribute, level)) |>
    mutate(model = "Bernoulli (model_conjoint)"),
  amces_categorical_draws |>
    mutate(model = "Categorical (model_conjoint_categorical)")
) |>
  ggplot(aes(x = draw, y = level_nice, color = model)) +
  geom_vline(xintercept = 0) +
  stat_pointinterval(position = position_dodge(width = 0.5)) +
  scale_x_continuous(labels = label_pp) +
  labs(x = "AMCE", y = NULL, color = NULL) +
  facet_wrap(vars(attribute_nice), scales = "free_y", ncol = 2) +
  theme(legend.position = "bottom")

Sample vs. US adults

NoteTODO

Appendix table comparing the sample’s demographics (age, gender, race, education, income, marital status) with the American Community Survey. This is descriptive context for generalizing the population-average estimands; we’re not reweighting or doing MRP.

tl;dr

These numbers are typed in by hand from the tables above, so they’ll need to be updated if the models change (or later I can use real inline code chunks)

Overall

  • Price matters most. Compared to free core services, a reduced price lowers the probability of choosing a nonprofit by 14 percentage points, and full price lowers it by 26.
  • Side businesses matter much less: −2 points for event space rental and −5 for a pizza shop.
  • For scale: a mental health center gets +16 points over an arts center, being under financial stress gets +6.5 over being in good condition, and earmarking donations for rainy day funds or unrestricted use costs about 6 points compared to paying program staff.

H5 (nonprofit experience)

  • H5a (price) is supported for volunteering only. The full price penalty is 5.1 points smaller among people who volunteer [2.5, 7.6], and the reduced price penalty is 2.8 points smaller [0.1, 5.5]. Both hold when adjusting for the other three indicators (5.4 and 3.1).
  • Volunteers’ smaller penalty comes mostly from a higher MM at full price, not a lower MM at free.
  • Giving frequency and $200+ giving have small positive differences in the price AMCEs (1.1–1.4 points, P(> 0) of 0.69–0.87) that go to about zero after adjustment. Nonprofit work shows nothing.
  • H5b (side businesses) isn’t supported. Every UBI difference is within ±1.6 points and every interval includes 0. There’s not much of a UBI effect to attenuate in the first place.

E3 (demographics, exploratory)

  • The full price penalty is smaller among conservatives (7.6 points smaller than liberals) and moderates (5.5), religious respondents (5.7), non-White respondents (4.5), and married or partnered respondents (3.1). Differences for reduced price are smaller and mostly include 0.
  • Part of the ideology gap is at the free level: liberals’ MM for free services (~46%) is higher than conservatives’ (~41%). Liberals reward free services more, and conservatives penalize full price less.
  • A few other single comparisons clear 0 (men’s reduced price penalty is 3.2 points larger than women’s; married respondents’ pizza shop penalty is 3.1 points larger), but they don’t form a pattern, and with 52 E3 comparisons a few of these are expected by chance.
  • Age, education, and income show no consistent differences.

Caveats

  • Subgroups differ in how often they chose “none” (e.g., 5.7% for liberals vs. 12% for moderates and conservatives; 6.0% for volunteers vs. 10.8% for non-volunteers). This shifts their MMs up or down, and differences in AMCEs only partly cancel it out.
  • None of the moderators are randomized, so subgroup differences are descriptive. Ideology, religion, education, income, and marital status were measured after the conjoint.
  • Setting respondent intercepts to 0 vs. averaging over each respondent’s intercept changes the MMs by at most 0.16 points.