dce_toolbox: Generate Efficient Optimal and Bayesian DCEs

View source: R/dce_toolbox.R

dce_toolboxR Documentation

Generate Efficient Optimal and Bayesian DCEs

Description

Generates experimental designs for DCEs. (Backend of DCEtool) .

Usage

  dce_toolbox(attributes, csets, alts, nochoice, priors, alg)

Arguments

attributes

A vector where each number represents an attribute and its values the number of levels.

csets

An integer indicating the number of sets in the DCE.

alts

An integer indicating the number of alternatives in each set.

nochoice

A boolean indicating whether there is an opt-out option (TRUE) or not (FALSE)

priors

A vector indicating the prior parameters of the conditional logit model.

alg

A string indicating the optimization algorithm: "cea" or "fedorov".

Value

design

The design matrix

DB-error

The Bayesian D-error if the optimization algorithm is "cea"

D-error

The D-error if the optimization algorithm is "fedorov"

details

A string compiling the details of the procedure

Examples

  dce_toolbox(c(2,3,3), 12, 2, 
  TRUE, c(0,0,0,0,0,0), "fedorov")
  
  dce_toolbox(c(2,3,3), 12, 2,
  TRUE, mvtnorm::rmvnorm(100,
                        c(0,0,0,0,0,0),
                        diag(length(c(0,0,0,0,0,0))))
      , "cea")

danielpereztr/DCEtool documentation built on April 16, 2024, 6:36 p.m.