R/tidy_stats.effsize.r

Defines functions tidy_stats.effsize

Documented in tidy_stats.effsize

#' @describeIn tidy_stats tidy_stats method for class 'effsize'
#' @export
tidy_stats.effsize <- function(x, args = NULL) {
  analysis <- list(method = paste(x$method, "effect size"))
  statistics <- list()

  # Determine the symbol, which is different from what is stored in the name
  # attribute in the case of a Cliff's Delta
  symbol <- dplyr::if_else(
    x$name == "delta",
    intToUtf8(0x03b4),
    x$name
  )

  statistics <- add_statistic(
    list = statistics,
    name = x$method,
    symbol = symbol,
    value = x$estimate,
    interval = "CI",
    level = x$conf.level,
    lower = x$conf.int[["lower"]],
    upper = x$conf.int[["upper"]]
  )

  analysis$statistics <- statistics

  analysis <- add_package_info(analysis, "effsize")

  return(analysis)
}

Try the tidystats package in your browser

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

tidystats documentation built on Oct. 17, 2023, 1:06 a.m.