R/sd_pool.R

Defines functions sd_pool

Documented in sd_pool

#' Pooled Standard Deviation Calculator
#'
#' \code{SD_pool} is a function for estimating a population standard deviation.
#' The equation comes from Morris (2008) who recommends pooling the pre-test
#' standard deviations of the control group and treatment group.
#'
#' @seealso Morris, S. B. (2008). Estimating Effect Sizes From
#' Pretest-Posttest-Control Group Designs. Organizational Research Methods,
#' 11(2), 364-386.
#' @param sd_t Pre-treatment standard deviation of the treatment group.
#' @param sd_c Pre-treatment standard deviation of the control group.
#' @param n_t Number of subjects in the treatment group.
#' @param n_c Number of subjects in the control group.
#'
#' @return Pooled standard deviation.
#'
#' @examples
#' sd_pool(sd_t = 1.17, sd_c = 1.4, n_t = 26, n_c = 22)

#'@export
sd_pool <- function(sd_t, sd_c, n_t, n_c){
   sqrt(
  (
    (n_t - 1) * (sd_t^2) + (n_c - 1) * (sd_c^2)
    ) /
    (n_t + n_c - 2)
  )
}
setgree/ResultsStandardizeR documentation built on Aug. 10, 2017, 2:20 a.m.