| summary.choicer_mnl | R Documentation |
Computes and returns a coefficient summary table with standard errors, z-values, p-values, and significance codes. Triggers lazy Hessian computation if standard errors have not been computed yet.
## S3 method for class 'choicer_mnl'
summary(object, gof = TRUE, ...)
object |
A choicer_mnl object. |
gof |
Logical; compute goodness-of-fit measures (McFadden R-squared, hit rate) for the summary footer. Involves an in-sample prediction pass (for mixed logit, a full simulation over draws); set to FALSE to skip. |
... |
Additional arguments (ignored). |
A summary.choicer_mnl object (list with coefficients table and
metadata, including a gof element with goodness-of-fit measures from
gof; its fields are NA when the model was fitted with
keep_data = FALSE).
library(data.table)
set.seed(42)
N <- 50; J <- 3
dt <- data.table(id = rep(1:N, each = J), alt = rep(1:J, N))
dt[, `:=`(x1 = rnorm(.N), x2 = rnorm(.N))]
dt[, choice := 0L]
dt[, choice := sample(c(1L, rep(0L, J - 1))), by = id]
fit <- run_mnlogit(dt, "id", "alt", "choice", c("x1", "x2"))
summary(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.