Visualize choice data
This function is the plot method for an object of class RprobitB_data
.
## S3 method for class 'RprobitB_data' plot(x, by_choice = FALSE, alpha = 1, position = "dodge", ...)
x
: An object of class RprobitB_data
.by_choice
: Set to TRUE
to group the covariates by the chosen alternatives.alpha, position
: Passed to ggplot
....
: Ignored.No return value. Draws a plot to the current device.
data <- simulate_choices( form = choice ~ cost | 0, N = 100, T = 10, J = 2, alternatives = c("bus", "car"), true_parameter = list("alpha" = -1) ) plot(data, by_choice = TRUE)
Useful links