MAD | R Documentation |
The functions compute the sum or mean of all pairwise absolute
differences. This differs from stats::mad()
, which computes
the median absolute difference of each value from the median of
all the values. See the ISIwithR
package (and the textbook it
accompanies) for examples using these functions in the context of
simulation-based inference.
MAD(x, ..., data = NULL, groups = NULL, na.rm = getOption("na.rm", FALSE))
SAD(x, ..., data = NULL, groups = NULL, na.rm = getOption("na.rm", FALSE))
x |
a numeric vector or a formula. |
... |
additional arguments passed through to |
data |
a data frame in which to evaluate formulas (or bare names).
Note that the default is |
groups |
a grouping variable, typically a name of a variable in |
na.rm |
a logical indicating whether NAs should be removed before calculating. |
the mean or sum of the absolute differences between each pair
of values in c(x,...)
.
mad()
, MAD_()
SAD(1:3)
MAD(1:3)
MAD(~eruptions, data = faithful)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.