R/adm.R

Defines functions adm

Documented in adm

# Copyright (c) 2020, Avraham Adler All rights reserved
# SPDX-License-Identifier: BSD-2-Clause

# Average Deviation from the Median with bias correction. Patterned after 'mad'
# in stats

adm <- function(x, center = median(x), constant = sqrt(pi / 2), na.rm = FALSE) {
  if (na.rm) {
    x <- x[!is.na(x)]
  }
  constant * mean(abs(x - center))
}

Try the revss package in your browser

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

revss documentation built on Feb. 16, 2023, 5:17 p.m.