R/e_value.R

Defines functions e_value

Documented in e_value

#' Calculate an E-value
#'
#' @param effect_observed Numeric positive value. Observed exposure - outcome effect
#'    (assumed to be the exponentiated coefficient, so a risk ratio, odds
#'    ratio, or hazard ratio). This can be the point estimate, lower confidence
#'    bound, or upper confidence bound.
#'
#' @return Numeric value
#' @export
#'
#' @examples
#' e_value(0.9)
#' e_value(1.3)
e_value <- function(effect_observed) {
  if (effect_observed <= 1) {
    effect_observed <- 1 / effect_observed
  }
  effect_observed + sqrt(effect_observed * (effect_observed - 1))
}

Try the tipr package in your browser

Any scripts or data that you put into this service are public.

tipr documentation built on Sept. 5, 2022, 5:09 p.m.