# dmnl <- design(
# Rlevels = c("left", "right", "up"),
# factors = list(subjects = 1, S = c("left", "right", "up")),
# formula = list(utility ~ lM),
# contrasts = list(utility = list(lM = matrix(c(-1/2, 1/2), ncol = 1))),
# matchfun = function(d) d$S == d$lR,
# model = multinomial_logit
# )
# dat <- make_data(c(utility = 0, utility_lM1 = 2), dmnl, n_trials = 40)
# plot_fit_choice(dat, style = "prob", factors = "S")
Run the code above in your browser using DataLab