Design Matrix Mahalanobis Distance
Returns the squared Mahalanobis distance of all rows in the design (model) matrix X and the sample mean vector μ of the columns of X with respect to the sample covariance matrix Σ. This is (for vector x' a row of X) defined as
d^{2} = (x - μ)' Σ^{-1} (x - μ)
where
μ = colMeans(X)
and
Σ = cov(X).
designMD(object, ...)
object |
a fitted model object with a |
... |
additional arguments are ignored. |
a numeric vector containing the squared Mahalanobis distances.
stack.lm <- lm(stack.loss ~ ., data = stackloss) # Mahalanobis distance (not squared) sqrt(designMD(stack.lm))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.