Print effect overviewSource:
This function gives an overview of the effect names, whether the covariate is alternative-specific, whether the coefficient is alternative-specific, and whether it is a random effect.
overview_effects( form, re = NULL, alternatives, base = tail(alternatives, 1), ordered = FALSE )
formulaobject that is used to specify the model equation. The structure is
choice ~ A | B | C, where
choiceis the name of the dependent variable (the choices),
Aare names of alternative and choice situation specific covariates with a coefficient that is constant across alternatives,
Bare names of choice situation specific covariates with alternative specific coefficients,
Care names of alternative and choice situation specific covariates with alternative specific coefficients.
Multiple covariates (of one type) are separated by a
+sign. By default, alternative specific constants (ASCs) are added to the model. They can be removed by adding
+0in the second spot.
In the ordered probit model (
ordered = TRUE), the
formulaobject has the simple structure
choice ~ A. ASCs are not estimated.
A character (vector) of covariates of
formwith random effects. If
re = NULL(the default), there are no random effects. To have random effects for the ASCs, include
A character vector with the names of the choice alternatives. If not specified, the choice set is defined by the observed choices. If
ordered = TRUE,
alternativesis assumed to be specified with the alternatives ordered from worst to best.
A character, the name of the base alternative for covariates that are not alternative specific (i.e. type 2 covariates and ASCs). Ignored and set to
NULLif the model has no alternative specific covariates (e.g. in the ordered probit model). Per default,
baseis the last element of
FALSEper default. If
TRUE, the choice set
alternativesis assumed to be ordered from worst to best.
A data frame, each row is a effect, columns are the effect name
"effect", and booleans whether the covariate is alternative-specific
"as_value", whether the coefficient is alternative-specific
"as_coef", and whether it is a random effect
check_form() for checking the model formula specification.
overview_effects( form = choice ~ price + time + comfort + change | 1, re = c("price", "time"), alternatives = c("A", "B"), base = "A" ) #> effect as_value as_coef random #> 1 comfort TRUE FALSE FALSE #> 2 change TRUE FALSE FALSE #> 3 ASC_B FALSE TRUE FALSE #> 4 price TRUE FALSE TRUE #> 5 time TRUE FALSE TRUE