Calculate univariate or multivariate (Mardia's test) skew and kurtosis for a vector, matrix, or data.frame

Description

Find the skew and kurtosis for each variable in a data.frame or matrix. Unlike skew and kurtosis in e1071, this calculates a different skew for each variable or column of a data.frame/matrix. mardia applies Mardia's tests for multivariate skew and kurtosis

Usage

Arguments

Plot the expected normal distribution values versus the Mahalanobis distance of the subjects.

Details

given a matrix or data.frame x, find the skew or kurtosis for each column (for skew and kurtosis) or the multivariate skew and kurtosis in the case of mardia.

As of version 1.2.3,when finding the skew and the kurtosis, there are three different options available. These match the choices available in skewness and kurtosis found in the e1071 package (see Joanes and Gill (1998) for the advantages of each one).

For consistency with e1071 and with the Joanes and Gill, the types are now defined as above.

However, from revision 1.0.93 to 1.2.3, kurtosi by default gives an unbiased estimate of the kurtosis (DeCarlo, 1997). Prior versions used a different equation which produced a biased estimate. (See the kurtosis function in the e1071 package for the distinction between these two formulae. The default, type 1 gave what is called type 2 in e1071. The other is their type 3.) For comparison with previous releases, specifying type = 2 will give the old estimate. These type numbers are now changed.

Value

skew

if input is a matrix or data.frame, skew is a vector of skews

kurtosi

if input is a matrix or data.frame, kurtosi is a vector of kurtosi

bp1

Mardia's bp1 estimate of multivariate skew

bp2

Mardia's bp2 estimate of multivariate kurtosis

skew

Mardia's skew statistic

small.skew

Mardia's small sample skew statistic

p.skew

Probability of skew

p.small

Probability of small.skew

kurtosis

Mardia's multivariate kurtosis statistic

p.kurtosis

Probability of kurtosis statistic

D

Mahalanobis distance of cases from centroid

Note

The mean function supplies means for the columns of a data.frame, but the overall mean for a matrix. Mean will throw a warning for non-numeric data, but colMeans stops with non-numeric data. Thus, the function uses either mean (for data frames) or colMeans (for matrices). This is true for skew and kurtosi as well.