md.hb: Hierarchical Bayes estimation for MaxDiff data

View source: R/maxdiff-estimate.R

md.hbR Documentation

Hierarchical Bayes estimation for MaxDiff data

Usage

md.hb(
  md.define,
  mcmc.iters = 1000,
  pitersUsed = 0.1,
  mcmc.seed = runif(1, min = 0, max = 1e+08),
  restart = FALSE
)

Arguments

md.define

The structured data with MaxDiff observations. This is typically created by an importing function such as read.md.qualtrics()

mcmc.iters

How many iterations to run the MCMC estimation process. Default is 1000 iterations (suitable only for testing), recommend 10000 or more for typical usage.

mcmc.seed

Random number seed to make the process repeatable. Default is that the function will draw a random number to be the seed and report it.

pitersUsers

The proportion of the MCMC chain to retain, from the end of the chain. Default 0.1 for 10

Returns a list with the following objects: md.model.hb is the result from a call to choicemodelr to estimate the model; md.hb.betas are the raw multinomial logit model beta coefficients; and md.hb.betas.zc are zero-centered difference scores that may be more interpretable for stakeholder audiences. Use plot.md.range() to plot the aggregate results, or plot.md.indiv() to plot the individual-level results, or plot.md.group() to compare distributions by categorical groups such as demographic or treatment groups. Estimates a hierarchical Bayes (HB) model for MaxDiff observations. This is primarily a wrapper for ChoiceModelR::choicemodelr that formats the data, calls choicemodelr, and extracts the results.


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