| mlogis | R Documentation |
Transformation between the vectors of multinomial probabilities and logits.
qmlogis(p)
pmlogis(q)
p |
double vector, multinomial probabilities |
q |
double vector, multinomial logits |
The function [pmlogis()] takes a length k-1 double vector of
multinomial logits q and convert them into length k multinomial probabilities p,
regarding the *first* category as reference.
The function [qmlogis()] takes a length k double vector of
multinomial probabilities p and convert them into length k-1 multinomial logits q,
regarding the *first* category as reference.
The function [pmlogis()] returns a double vector of multinomial probabilities p.
The function [qmlogis()] returns a double vector of multinomial logits q.
This transformation is a generalization of functions plogis (i.e., logit to probability) and qlogis (i.e., probability to logit).
c(2,5,3) |> qmlogis() |> pmlogis()
# various exceptions
c(1, 0) |> qmlogis() |> pmlogis()
c(0, 1) |> qmlogis() |> pmlogis()
c(0, 0, 1) |> qmlogis() |> pmlogis()
c(1, 0, 0, 0) |> qmlogis() |> pmlogis()
c(0, 1, 0, 0) |> qmlogis() |> pmlogis()
c(0, 0, 1, 0) |> qmlogis() |> pmlogis()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.