View source: R/choice_effects.R
| choice_effects | R Documentation |
This function constructs an object of class choice_effects, which
defines the effects of a choice model.
choice_effects(
choice_formula,
choice_alternatives,
choice_data = NULL,
delimiter = "_"
)
## S3 method for class 'choice_effects'
print(x, ...)
choice_formula |
[ |
choice_alternatives |
[ |
choice_data |
[ Required to resolve data-dependent elements in |
delimiter |
[ |
x |
[ |
... |
Currently not used. |
A choice_effects object, which is a data.frame, where each row
is a model effect, and columns are
"effect_name", the name for the effect which is composed of
covariate and alternative name,
"generic_name", the generic effect name "beta_<effect number>",
"covariate", the (transformed) covariate name connected to the effect,
"alternative", the alternative name connected to the effect (only
if the effect is alternative-specific),
"as_covariate", indicator whether the covariate is alternative-specific,
"as_effect", indicator whether the effect is alternative-specific,
"mixing", a factor with levels in the order
"cn" (correlated normal distribution),
indicating the type of random effect.
For identification, the choice effects are ordered according to the following rules:
Non-random effects come before random effects.
According to the ordering of the factor mixing.
Otherwise, the order is determined by occurrence in formula.
It contains the arguments choice_formula, choice_alternatives, and
delimiter as attributes.
choice_effects(
choice_formula = choice_formula(
formula = choice ~ price | income | I(comfort == 1),
error_term = "probit",
random_effects = c(
"price" = "cn",
"income" = "cn"
)
),
choice_alternatives = choice_alternatives(J = 3)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.