This is the inverse of the function that calculates odds from probabilities. For any given value of odds, the corresponding probability p where odds = p/(1-p) is returned.

odds_to_probs(odds)

Arguments

odds

A numeric vector of non-negative values, representing odds.

Value

A numeric vector of probabilities.

Examples

odds <- c(1, 3, 9)
odds_to_probs(odds)
#> [1] 0.50 0.75 0.90