50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


e1071 (version 1.7-16)

kurtosis: Kurtosis

Description

Computes the kurtosis.

Usage

kurtosis(x, na.rm = FALSE, type = 3)

Value

The estimated kurtosis of x.

Arguments

x

a numeric vector containing the values whose kurtosis is to be computed.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

type

an integer between 1 and 3 selecting one of the algorithms for computing kurtosis detailed below.

Details

If x contains missings and these are not removed, the kurtosis is NA.

Otherwise, write xi for the non-missing elements of x, n for their number, μ for their mean, s for their standard deviation, and mr=i(xiμ)r/n for the sample moments of order r.

Joanes and Gill (1998) discuss three methods for estimating kurtosis:

Type 1:

g2=m4/m223. This is the typical definition used in many older textbooks.

Type 2:

G2=((n+1)g2+6)(n1)/((n2)(n3)). Used in SAS and SPSS.

Type 3:

b2=m4/s43=(g2+3)(11/n)23. Used in MINITAB and BMDP.

Only G2 (corresponding to type = 2) is unbiased under normality.

References

D. N. Joanes and C. A. Gill (1998), Comparing measures of sample skewness and kurtosis. The Statistician, 47, 183--189.

Examples

Run this code
x <- rnorm(100)
kurtosis(x)

Run the code above in your browser using DataLab