R/iconfianza.geometrica.R

Defines functions iconfianza.geometrica

Documented in iconfianza.geometrica

#' confidence interval for the geometric mean using the log-normal approximation
#'
#' @keywords internal
iconfianza.geometrica <- function(datos, nivel = 0.95, ic = T, colas = 2, use.t = F) {
  iconfres <- rep(NA, 3)
  if (all(is.na(datos))) {
    iconfres <- rep(NA, 3)
  } else if (all(datos != 0, na.rm = T)) {
    lx <- log(datos)
    med <- exp(iconfianza.aritmetica(lx, nivel, ic, colas, use.t))
    iconfres <- med
  } else {
    datos.no.cero <- datos + 1
    lx <- log(datos.no.cero)
    med <- exp(iconfianza.aritmetica(lx, nivel, ic, colas, use.t)) - 1
    iconfres <- med
  }
  iconfres
}
lozalojo/mem documentation built on April 1, 2021, 1:37 a.m.