R/d_to_r.R

#' Convert d to correlation coefficient
#'
#' This function allows you to convert d to Pearson's
#' correlation coefficient.
#'
#' @param d the effect size to convert
#' @return correlation coefficient
#'
#' @keywords effect size cohen's d convert correlation
#'
#' @examples
#' d_to_r(.25)
#'
#' @rdname d_to_r
#' @export
#'
d_to_r <- function (d) {

  if (missing(d)){
    stop("Be sure to include d.")
  }

 return(d / sqrt((d^2+4)))

}

Try the ViSe package in your browser

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

ViSe documentation built on Oct. 10, 2024, 9:07 a.m.