plot.md.indiv: Plot individual-level estimates (density) for MaxDiff...

View source: R/maxdiff-plots.R

plot.md.indivR Documentation

Plot individual-level estimates (density) for MaxDiff utilites

Description

This plot shows each individual's estimates as a blue circle for each item, and allows visual inspection of the degree of dispersion and general density properties of the estimates. The sample level mean value is plotted as a red box.

Usage

## S3 method for class 'md.indiv'
plot(
  md.define,
  use.raw = FALSE,
  item.disguise = FALSE,
  plot.zero = FALSE,
  plot.density = TRUE,
  plot.mean = TRUE,
  ran.seed = 98103
)

Arguments

md.define

A MaxDiff study object that contains individual-level utility estimates present in a member called $md.hb.betas or $md.hb.betas.zc. Typically those are estimated created by md.hb() in this package.

These data also be imported or created by any other process, as long as they are rectangular with items in the columns and respondents in the rows, and there is an "ID" column with unique respondent identifies for each row. For example, if you export data from Sawtooth Software or some other platform, you could load and plot it with this function; just create an object md.define$md.hb.betas with the estimates and an ID column.

use.raw

Whether to use raw MNL beta coefficients $md.hb.betas, if present, or some transformed e.g., zero-centered diff, version of them present in $md.hb.betas

item.disguise

Remove the item labels and number them generically. This is included to make it easy to share and show results at a conference or other audience when the underlying details are confidential.

plot.zero

Plot a vertical line for zero (the point of indifference), which only applies for raw beta utilities.

plot.density

Whether to draw density lines

plot.mean

Whether to add the sample mean value as a red box

ran.seed

RNG seed for the minor jittering that is added to the plot for better filling of the density areas.

Value

A ggplot2 object with the plot.


cnchapman/choicetools documentation built on May 28, 2023, 9:14 a.m.