choice_probabilities function

Compute choice probabilities

Compute choice probabilities

This function returns the choice probabilities of an RprobitB_fit

object.

choice_probabilities(x, data = NULL, par_set = mean)

Arguments

  • x: An object of class RprobitB_fit.

  • data: Either NULL or an object of class RprobitB_data. In the former case, choice probabilities are computed for the data that was used for model fitting. Alternatively, a new data set can be provided.

  • par_set: Specifying the parameter set for calculation and either

    • a function that computes a posterior point estimate (the default is mean()),
    • "true" to select the true parameter set,
    • an object of class RprobitB_parameter.

Returns

A data frame of choice probabilities with choice situations in rows and alternatives in columns. The first two columns are the decider identifier "id" and the choice situation identifier "idc".

Examples

data <- simulate_choices(form = choice ~ covariate, N = 10, T = 10, J = 2) x <- fit_model(data) choice_probabilities(x)