logit {lca} | R Documentation |
Function to transform logit scale values (over [0,1]) to the real line and back.
logit(z) expit(x)
z |
a vector of values between 0 and 1 to be mapped. |
x |
a vector of real values. |
logit
is defined as log(z / (1 - z))
for any value between 0 and 1. logit(0) = -Inf
and logit(1) = Inf
as this corresponds with limits.
Similarly, expit
= e^x / (1 + e^x)
is the inverse function for any real value.
Both functions return vector of the same length as the input.
Robin Evans
z = c(0.3, 0.2, 1) x = logit(z) x expit(x)