R/apa.zstat.r

#' @title apa.zstat
#'
#' @description APA formating for the z statistic
#'
#' @export
#'
#' @param z z statistic to be formatted
#' @return the formatted value as a \code{\link[base]{character}}
#'
#' @author Mark Newman, \email{mark@trinetteandmark.com}
#' @keywords statistic
#' @family statistic
#' 
#' @examples
#'   zs = apa.zstat(1.1234)
#'   zss = apa.zstat(c(1.1234, 2.0007, 0.0342))
#'   # In the markdown put `r zs` or `r zss`
#'
apa.zstat = function(z) {
  
  res = sprintf("$z$ = %s", round(z, 3))
  
  return(res)
}
markanewman/apaformat documentation built on May 10, 2019, 1:19 a.m.