Check model formulaSource:
This function checks the input
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
FALSEper default. If
TRUE, the choice set
alternativesis assumed to be ordered from worst to best.
A list that contains the following elements:
choiceof the dependent variable in
varsof three character vectors of covariate names of the three covariate types.
ASC, determining whether the model has ASCs.
overview_effects() for an overview of the model effects
form <- choice ~ price + time + comfort + change re <- c("price", "time") RprobitB:::check_form(form = form, re = re) #> $form #> choice ~ price + time + comfort + change #> <environment: 0x7fa7401b96d0> #> #> $choice #>  "choice" #> #> $re #>  "price" "time" #> #> $vars #> $vars[] #>  "price" "time" "comfort" "change" #> #> $vars[] #> character(0) #> #> $vars[] #> character(0) #> #> #> $ASC #>  TRUE #>