Mahalanobis depth | R Documentation |

Mahalanobis depth.

```
depth.mahala(x, data)
```

`x` |
A numerical vector or matrix whose depth you want to compute. |

`data` |
A numerical matrix used to compute the depth of x. |

This function computes the Mahalanobis depth of x with respect to data.

A numevrical vector with the Mahalanobis depth for each value of x.

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Mahalanobis P. (1936). On the generalized distance in statistics. Proceedings of the National Academy India, 12 49–55.

Liu R.Y. (1992). Data depth and multivariate rank tests. In Dodge Y. (editors), L1-Statistics and Related Methods, 279–294.

```
welch.tests, trim.mean
```

```
x <- as.matrix(iris[1:50, 1:4])
depth.mahala(x, x)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.