R/z.to.cl.R

Defines functions z.to.cl

#' Convert a Z-value to a confidence level
#'
#' Adapted from https://datascience.stackexchange.com/questions/10093/how-to-find-a-confidence-level-given-the-z-value
#'
#' @param z A Z-value (real number)
#'
#' @return the confidence level
#'
#' @examples
#' library(rAnaLab)
#' print(z.to.cl(.950))
#'
#' @export
#'
z.to.cl <- function(z){
  val <- pnorm(z, lower.tail=FALSE)
  cl <- 1.0 - (2.0*val)
  return(cl)
}
jrminter/rAnaLab documentation built on July 20, 2020, 4:09 a.m.