Learn R Programming

swfscMisc (version 1.6.5)

odds: Odds Conversion

Description

oddsconverts probability to odds
logOddsconverts odds to log-odds
invOddsconverts odds to probability
invLogOddsconverts log-odds to odds

Usage

odds(x)

logOdds(x)

invOdds(x)

invLogOdds(x)

Arguments

x

a numeric vector of probabilities (0 to 1), odds (0 to Inf), or log.odds (-Inf to Inf).

Author

Eric Archer eric.archer@noaa.gov

Examples

Run this code
x <- sort(runif(10))
odds.df <- data.frame(x = x, odds = odds(x), logOdds = logOdds(x))
odds.df
invOdds(odds.df$odds)
invLogOdds(odds.df$logOdds)

Run the code above in your browser using DataLab