FitMaxDiff: 'FitMaxDiff'

Description Usage Arguments

View source: R/max-diff.R

Description

Fits a latent class rank-ordered logit model with ties to a max-diff experiment.

Usage

1
2
3
4
5
6
7
8
9
FitMaxDiff(design, version = NULL, best, worst, alternative.names,
  n.classes = 1, subset = NULL, weights = NULL, characteristics = NULL,
  seed = 123, initial.parameters = NULL, trace = 0,
  sub.model.outputs = FALSE, lc = TRUE, output = "Probabilities",
  tasks.left.out = 0, is.mixture.of.normals = FALSE,
  algorithm = "Default", normal.covariance = "Full",
  pool.variance = FALSE, lc.tolerance = 1e-04, n.draws = 100,
  is.tricked = FALSE, hb.iterations = 100, hb.chains = 1,
  hb.max.tree.depth = 10, hb.adapt.delta = 0.8)

Arguments

design

A data.frame, where the first variable is called 'Version', the second is called 'Task' or 'Question', and the remaining variables contain the alternatives shown in each task.

version

A vector of integers showing the version of the design shown to each respondent.

best

A data frame of factors or a matrix of integers showing the choices made by each respondent on each of the questions. One column for each task. The integers need to correspond to the design vector of integers showing the version of the design shown to each respondent. Coerced to a matrix if a data.frame.

worst

As with 'best', except denoting worst..

alternative.names

A character vector of the alternative names. Where best and worst are factors or characters, these names must match them.

n.classes

The number of latent classes.

subset

An optional vector specifying a subset of observations to be used in the fitting process.

weights

An optional vector of sampling or frequency weights.

characteristics

Data frame of characteristics on which to run varying coefficients by latent class boosting.

seed

Seed for initial random class assignments.

initial.parameters

Specify initial parameters intead of starting at random.

trace

Non-negative integer indicating the detail of outputs provided when fitting models: 0 indicates no outputs, and 6 is the most detailed outputs.

sub.model.outputs

If TRUE, prints diagnostics on interim models.

lc

Whether to run latent class step at the end if characteristics are supplied.

output

Output type. Can be "Probabilities" or "Classes".

tasks.left.out

Number of questions to leave out for cross-validation.

is.mixture.of.normals

Whether to model with mixture of normals instead of LCA.

algorithm

If "HB", Hierarchical Bayes with a MVN prior is used and the other parameters are ignored.

normal.covariance

The form of the covariance matrix for mixture of normals. Can be 'Full, 'Spherical', 'Diagonal'.

pool.variance

Whether to pool parameter covariances between classes in mixture of normals.

lc.tolerance

The tolerance used for defining convergence in latent class analysis.

n.draws

The number of draws when fitting mixture of normals.

is.tricked

Whether to use tricked logit instead of rank-ordered logit with ties.

hb.iterations

The number of iterations in Hierarchical Bayes.

hb.chains

The number of chains in Hierarchical Bayes.

hb.max.tree.depth

http://mc-stan.org/misc/warnings.html#maximum-treedepth-exceeded

hb.adapt.delta

http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup


erikerhardt/flipMaxDiff documentation built on June 21, 2020, 12:54 a.m.