odds_to_probs function

Convert Between Odds and Probabilities

Convert Between Odds and Probabilities

odds_to_probs(odds, log = FALSE, ...) ## S3 method for class 'data.frame' odds_to_probs(odds, log = FALSE, select = NULL, exclude = NULL, ...) probs_to_odds(probs, log = FALSE, ...) ## S3 method for class 'data.frame' probs_to_odds(probs, log = FALSE, select = NULL, exclude = NULL, ...)

Arguments

  • odds: The Odds (or log(odds) when log = TRUE) to convert.
  • log: Take in or output log odds (such as in logistic models).
  • ...: Arguments passed to or from other methods.
  • select: When a data frame is passed, character or list of of column names to be transformed.
  • exclude: When a data frame is passed, character or list of column names to be excluded from transformation.
  • probs: Probability values to convert.

Returns

Converted index.

Examples

odds_to_probs(3) odds_to_probs(1.09, log = TRUE) probs_to_odds(0.95) probs_to_odds(0.95, log = TRUE)

See Also

stats::plogis()

Other convert between effect sizes: d_to_r(), diff_to_cles, eta2_to_f2(), oddsratio_to_riskratio(), w_to_fei()

  • Maintainer: Mattan S. Ben-Shachar
  • License: MIT + file LICENSE
  • Last published: 2024-12-10