% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/convert_between_riskchange_ro_probs.R
\name{oddsratio_to_probs}
\alias{oddsratio_to_probs}
\alias{logoddsratio_to_probs}
\alias{riskratio_to_probs}
\alias{arr_to_probs}
\alias{nnt_to_probs}
\title{Convert Between Metrics of Change in Probabilities and Probabilities}
\usage{
oddsratio_to_probs(OR, p0, log = FALSE, odds = FALSE, ...)

logoddsratio_to_probs(logOR, p0, log = TRUE, odds = FALSE, ...)

riskratio_to_probs(RR, p0, odds = FALSE, ...)

arr_to_probs(ARR, p0, odds = FALSE, ...)

nnt_to_probs(NNT, p0, odds = FALSE, ...)
}
\arguments{
\item{OR, logOR, RR, ARR, NNT}{Odds-ratio of \code{odds(p1)/odds(p0)}, log-Odds-ratio
of \code{log(odds(p1)/odds(p0))}, Risk ratio of \code{p1/p0}, Absolute Risk Reduction
of \code{p1 - p0}, or Number-needed-to-treat of \code{1/(p1 - p0)}. \code{OR} and \code{logOR}
can also be a logistic regression model.}

\item{p0}{Baseline risk}

\item{log}{If:
\itemize{
\item \code{TRUE}:
\itemize{
\item In \verb{oddsratio_to_*()}, \code{OR} input is treated as \code{log(OR)}.
\item In \verb{*_to_oddsratio()}, returned value is \code{log(OR)}.
}
\item \code{FALSE}:
\itemize{
\item In \verb{logoddsratio_to_*()}, \code{logOR} input is treated as \code{OR}.
\item In \verb{*_to_logoddsratio()}, returned value is \code{OR}.
}
}}

\item{odds}{Should odds be returned instead of probabilities?}

\item{...}{Arguments passed to and from other methods.}
}
\value{
Probabilities (or probability odds).
}
\description{
Convert Between Metrics of Change in Probabilities and Probabilities
}
\examples{

p0 <- 0.4
p1 <- 0.7

(OR <- probs_to_odds(p1) / probs_to_odds(p0))
(RR <- p1 / p0)
(ARR <- p1 - p0)
(NNT <- arr_to_nnt(ARR))

riskratio_to_probs(RR, p0 = p0)
oddsratio_to_probs(OR, p0 = p0)

all.equal(nnt_to_probs(NNT, p0 = p0, odds = TRUE),
          probs_to_odds(p1))

arr_to_probs(-ARR, p0 = p1)
nnt_to_probs(-NNT, p0 = p1)



# RR |>
#   riskratio_to_arr(p0) |>
#   arr_to_oddsratio(p0) |>
#   oddsratio_to_nnt(p0) |>
#   nnt_to_probs(p0)

}
\seealso{
\code{\link[=oddsratio]{oddsratio()}}, \code{\link[=riskratio]{riskratio()}}, \code{\link[=arr]{arr()}}, and \code{\link[=nnt]{nnt()}},
\code{\link[=odds_to_probs]{odds_to_probs()}}, and \code{\link[=oddsratio_to_arr]{oddsratio_to_arr()}} and others.
}
