| logit_model | R Documentation |
Define a cross-sectional multinomial logit model
logit_model(
database,
choice,
utilities,
availability = NULL,
alternative_codes = NULL,
weight = NULL
)
database |
A |
choice |
Name of the integer-valued choice column. |
utilities |
Named list of utility expressions, one per alternative. |
availability |
Optional named list of availability expressions. |
alternative_codes |
Optional named integer vector mapping utility names to values in the choice column. If omitted, utility names must themselves be integer codes. |
weight |
Optional observation-weight expression. |
The utility list is named by alternative. If the names are not integer
codes, pass alternative_codes as a named integer vector. Availability and
weights may be constants or symbolic expressions.
An object of class biogeme_logit_model.
database <- biogeme_database(
"demo",
data.frame(choice = c(1, 2), x = c(1, 2))
)
b <- biogeme_beta("b")
model <- logit_model(
database,
choice = "choice",
utilities = list(`1` = 0, `2` = b * variable("x"))
)
model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.