Learn R Programming

descriptr (version 0.6.1)

ds_skewness: Skewness

Description

Compute the skewness of a probability distribution.

Usage

ds_skewness(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. For \(n\) non-missing observations, sample standard deviation \(s\) and \(m_k = \sum ((x_i - \bar{x}) / s)^k\), the skewness is $$G_1 = \frac{n}{(n - 1)(n - 2)} m_3.$$ This is the adjusted Fisher-Pearson standardized moment coefficient; it matches e1071::skewness(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

kurtosis

Examples

Run this code
# vector
ds_skewness(mtcars$mpg)

# data.frame
ds_skewness(mtcars, mpg)

Run the code above in your browser using DataLab