Learn R Programming

descriptr (version 0.6.1)

ds_kurtosis: Kurtosis

Description

Compute the kurtosis of a probability distribution.

Usage

ds_kurtosis(data, x = NULL)

Arguments

data

A numeric vector or data.frame.

x

Column in data.

Details

Any NA values are stripped from x before computation takes place. With \(n\) non-missing observations, sample standard deviation \(s\), \(m_k = \sum ((x_i - \bar{x}) / s)^k\) and $$G_2 = \frac{n (n + 1)}{(n - 1)(n - 2)(n - 3)} m_4 - \frac{3 (n - 1)^2}{(n - 2)(n - 3)},$$ this is the excess kurtosis. It matches e1071::kurtosis(x, type = 2) and the SAS/SPSS definition.

References

Sheskin, D.J. (2000) Handbook of Parametric and Nonparametric Statistical Procedures, Second Edition. Boca Raton, Florida: Chapman & Hall/CRC.

See Also

ds_skewness

Examples

Run this code
# vector
ds_kurtosis(mtcars$mpg)

# data.frame
ds_kurtosis(mtcars, mpg)

Run the code above in your browser using DataLab