R/cs_std_dev.R

Defines functions cs_std_dev

Documented in cs_std_dev

#' Calculate the corrected sample standard deviation.
#' @param values numeric values
#' @return the corrected sample standard deviation
#' @author Richèl J.C. Bilderbeek
#' @export
cs_std_dev <- function(values) {

  mean <- mean(values)

  # Errors
  es <- values - mean

  # Squared Errors
  ses <- es * es

  # Sum of Squared Errors
  sses <- sum(ses)

  n <- length(values)
  f <- 1.0 / (n - 1.0)

  s <- sqrt(f * sses)
  s
}

Try the tracerer package in your browser

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

tracerer documentation built on Sept. 27, 2023, 5:09 p.m.