ilogit | R Documentation |
Calculate the inverse logit function exp(x) / (1 + exp(x))
. Modified from Faraway package.
The original allowed for some elements to be NA
which this does not. I added a check
on x
to avoid NaN
. This occurs when x
is greater than about
750 but, since exp(x) / (1 + exp(x)) = 1
for x>=20
, I only check for x > 20 and
output 1 for these cases.
ilogit(x)
x |
A numeric vector. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.