Skip to contents

Baseline-category logit / softmax family for a single unordered categorical response with \(K \ge 3\) categories. For a categorical trait with categories \(1, \ldots, K\) and reference category 1, the model is \(\eta_{k} = \beta_{0k} + x^\top \beta_k\) for \(k = 2, \ldots, K\) with \(\eta_1 \equiv 0\), and \(\Pr(y = k) = \exp(\eta_k) / \sum_j \exp(\eta_j)\) (softmax). It recovers the \((K-1)\) per-category intercepts and slopes as contrasts against the reference category.

Usage

multinomial(link = "logit", baseline = NULL)

Arguments

Character; only the baseline-category "logit" link is supported (present for API symmetry).

baseline

Optional reference category (level of the response factor) pinned at \(\eta = 0\). NULL (default) uses the first factor level.

Value

A family object with class c("multinomial", "family").

Details

This is a response family and must not be confused with the categorical() constructor, which is a missing-predictor imputation family. In this release the multinomial family is fixed-effects only: latent / random-effect / structured terms (latent(), unique(), indep(), phylo_*(), spatial_*(), random slopes, cluster) on a multinomial trait are not supported, because an unordered categorical response spans \(K-1\) latent liability dimensions rather than one. A two-category response is exactly binomial(link = "logit") and is redirected there. See also ordinal_probit() for ordered categories.

See also

ordinal_probit() for ordered categories; categorical() for the missing-predictor imputation namesake.

Examples

multinomial()
#> 
#> Family: multinomial 
#> Link function: logit 
#>