Navigation

Operators and Keywords

Function List:

C++ API

Function File: mad (x)

Function File: mad (x, flag)

Function File: mad (x, flag, dim)

Compute the mean/median absolute deviation of x.

The mean absolute deviation is computed as

          mean (abs (x - mean (x)))

and the median absolute deviation is computed as

          median (abs (x - median (x)))

Elements of x containing NaN or NA values are ignored during computations.

If flag is 0, the absolute mean deviation is computed, and if flag is 1, the absolute median deviation is computed. By default flag is 0.

This is done along the dimension dim of x. If this variable is not given, the mean/median absolute deviation s computed along the smallest dimension of x.

See also: std

Package: statistics