Model definitions

Formal math

 Multinomial probability of selection of choicei in respondentjChoiceij Categorical({μ1,ij,μ2,ij,μ3,ij}) Model for probability of each option{μ1,ij,μ2,ij,μ3,ij}= (β0+b0j)+β1Organization[Greenpeace]ij+β2Organization[Oxfam]ij+ β3Organization[Red Cross]ij+β4Issue[Environment]ij+ β5Issue[Human rights]ij+β6Issue[Refugee relief]ij+ β7Transparency[Yes]ij+β8Accountability[Yes]ij+ β9Funding[Few wealthy donors]ij+β10Funding[Government grants]ij+ β11Government relationship[Criticized]ij+ β12Government relationship[Under crackdown]ijb0j N(0,σ0)Respondent-specific offsets from global probability Priorsβ012 N(0,3)  Prior for choice-level coefficientsσ0 Exponential(1)Prior for between-respondent variability

R code

R/funs_models.R
f_treatment_only <- function(dat) {
  BAYES_SEED <- 706615  # From random.org

  categorical_priors <- c(
    prior(normal(0, 3), class = b, dpar = mu1),
    prior(normal(0, 3), class = b, dpar = mu2),
    prior(normal(0, 3), class = b, dpar = mu3),
    prior(exponential(1), class = sd, dpar = mu1),
    prior(exponential(1), class = sd, dpar = mu2),
    prior(exponential(1), class = sd, dpar = mu3) # ,
  )

  model <- brm(
    bf(choice_alt ~
      # Conjoint attributes (treatment variables)
      feat_org + feat_issue + feat_transp + feat_acc + feat_funding + feat_govt +
      # Respondent-specific intercepts
      (1 | id)),
    data = dat,
    family = categorical(refcat = "0"),
    prior = categorical_priors,
    chains = 4, warmup = 1000, iter = 5000, seed = BAYES_SEED, refresh = 10
  )

  return(model)
}