Description Usage Arguments Details Value Author(s) References See Also
View source: R/mahalanobis_miss.R
This function is a modified version of MDmiss
function in modi
package.
1 | mahalanobis_miss(data, center, cov, ...)
|
data |
the data as a dataframe or matrix. |
center |
the center to be used (may not contain missing values). |
cov |
the covariance to be used (may not contain missing values). |
... |
Additional arguments passed to mahalanobis if no missing values exist. |
For each observation the missing dimensions are omitted before calculating the MD. The MD contains a correction factor p/q to account for the number of observed values, where p is the number of variables and q is the number of observed dimensions for the particular observation.
The function loops over the observations unless all values are non-missing. This is not optimal if only a few missingness patterns occur. If no missing values occur the function returns the Mahalanobis distance.
The function returns a vector of the (squared) Mahalanobis distances.
Beat Hulliger (Original in modi
package). Modified by Gento Kato.
Béguin, C., and Hulliger, B. (2004). Multivariate outlier detection in incomplete survey data: The epidemic algorithm and transformed rank correlations. Journal of the Royal Statistical Society, A167 (Part 2.), pp. 275-294.
mahalanobis
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.