powered by
Compute generalized logit and generalized inverse logit functions.
Logit(x, min = 0, max = 1) LogitInv(x, min = 0, max = 1)
value(s) to be transformed
lower end of logit interval
upper end of logit interval
Transformed value(s).
The generalized logit function takes values on [min, max] and transforms them to span \([-\infty, \infty ]\). It is defined as:
$$y = log\left (\frac{p}{1-p} \right ) \;\;\; \; \textup{where} \; \;\; p=\frac{x-min}{max-min}$$
The generalized inverse logit function provides the inverse transformation:
$$x = p' \cdot (max-min) + min \;\;\; \; \textup{where} \; \;\; p'=\frac{exp(y)}{1+exp(y)}$$
logit
# NOT RUN { x <- seq(0,10, by=0.25) xt <- Logit(x, min=0, max=10) cbind(x,xt) y <- LogitInv(xt, min=0, max=10) cbind(x, xt, y) # }
Run the code above in your browser using DataLab