mult.norm | R Documentation |
Returns tests for multivariate Skewness and kurtosis as well as Mahalanobis' D-squared.
mult.norm(x, s = var(x), chicrit = 0.005)
x |
A multivariate data object as in columns from a data.frame |
s |
Covariance matrix of x (not necessary to specify) |
chicrit |
p-value corresponding to critical value of chi-square distribution for detecting multivariate outliers |
Tests for multivariate skewness and kurtosis were adapted from SAS macros in Khatree & Naik (1999). They attribute the formula to Mardia (1970; 1974). Mahalanobis' Dsq is based on Mahalanobis (1936). Dsq is multivariate analogue to z scores, but based on the chi-sq distribution rather than normal distribution. Once can specify at what level one wishes to define multivariate outliers (e.g., .005, .001)
A list containing the following:
mult.test |
Values for multivariate skeweness and kurtosis and their significance |
Dsq |
Mahalanobis' distances |
CriticalDsq |
Critical value of chi-sq distribution based on df and specified critical level |
Mahalanobis is returned without regard to NAs (missing observations) and is useful only in detecting IF multivariate outliers are present. If one wishes to determine which cases are multivariate outliers and if one has missing observations, mahalanobis
is perhaps a better choice.
These statistics are known to be susceptible to sample size (as in their univariate counterparts). One should always use graphical methods such as qqplot
in addition to statistical.
Thomas D. Fletcher t.d.fletcher05@gmail.com
Khattree, R. & Naik, D. N. (1999). Applied multivariate statistics with SAS software (2nd ed.). Cary, NC: SAS Institute Inc.
mahalanobis
, qqplot
# assess the multivariate normality of variables 4,5,6 in USJudgeRatings data(USJudgeRatings) mn <- mult.norm(USJudgeRatings[,4:6],chicrit=.001) mn mn$Dsq > mn$CriticalDsq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.