R/se_sx.R

Defines functions se_sx

Documented in se_sx

#' @rdname se_meanx
#' @export
se_sx <- function(x, na.rm = FALSE) {
  if (na.rm) {
    x <- x[!is.na(x)]
  }
  root_n <- sqrt(length(x))
  x_bar <- mean(x)
  sx <- stats::sd(x)
  sqrt(mean((x - x_bar)^4) - sx^4) / (2 * root_n * sx)
}

Try the probstats4econ package in your browser

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

probstats4econ documentation built on Sept. 11, 2024, 8:29 p.m.