mahalDist: Get squared Mahalanobis distances for N observations in M...

Usage Arguments Details Value Author(s) See Also

Usage

1
mahalDist(m, scale = TRUE, use = "complete.obs", center = "mean")

Arguments

m

A data.frame or matrix. Observations in rows.

scale

If TRUE, scale variables before getting mahalanobis distances.

use

Observations to use in computing covariance matrix. Gets passed to cov.

center

Type of univariate center for each variable in m; "mean" or "median"

Details

Get squared Mahalanobis distances for N observations in M dimensions. This is a convenience wrapper around mahalanobis, which see. Variables are optionally scaled before distances are computed. Incomplete observations will return NA.

Value

A list with additional class "mahalDist" containing elements:

  1. D2: A vector of squared Mahalanobis distances for observations (rows) in m. Incomplete observations return NA.

  2. vars: A character vector with the column names from m.

  3. dim: The number of columns of m.

Author(s)

Dave Braze davebraze@gmail.com

See Also

mahalanobis

cov


davebraze/FDB1 documentation built on May 14, 2019, 8:59 p.m.