This function calculates the logit (log of the odds) of a set of probabilities.

logit(p, na.rm = TRUE)

Arguments

p

A set of probabilities (0 ≤ p ≤ 1).

na.rm

Logical; if TRUE, removes NA values first.

Value

Returns a set of values that now lie between -∞ and ∞.

Examples

round(logit(c(.5, .1, .9, 0, 1)), 6)
#> [1]  0.000000 -2.197225  2.197225      -Inf       Inf