R: Mean - Median absolute deviation of a vector

Mean - Median absolute deviation of a vector {Rfast} | R Documentation

## Mean - Median absolute deviation of a vector

### Description

Mean - Median absolute deviation of a vector.

### Usage

    mad2(x,method = "median",na.rm=FALSE)
    Mad(x,method = "median",na.rm=FALSE)

### Arguments

`x` | A numerical vector.
`method` | A character vector with values "median", for median absolute deviation or "mean", for mean absolute deviation.
`na.rm` | A logical value TRUE/FALSE to remove NAs.

### Value

The mean absolute deviation.

### Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@yahoo.gr>

### See Also

`colMads, Median, colMedians`

### Examples

    x <- Rnorm(1000)
    Mad(x)
    mad(x)

[Package Rfast version 2.0.0 Index]