Logit and Inverse-Logit Functions
Transform values to and from the logit scale. logit()
calculates
logit(p) invlogit(x)
p
: Values in the interval [0, 1]
. Can be an atomic vector, a matrix, or an rvec .x
: Values in the interval (-Inf, Inf)
. Can be an atomic vector, a matrix, or an rvec .p
or x
is a vector.p
or x
is a matrix.rvec_dbl
, if p
or x
is an rvec.and invlogit()
calculates
To avoid overflow, invlogit()
uses
internally for where .
In some of the demographic literature, the logit function is defined as
logit()
and invlogit()
follow the conventions in statistics and machine learning, and omit the .
p <- c(0.5, 1, 0.2) logit(p) invlogit(logit(p))
Useful links