e1071 (version 1.5-20)

skewness: Skewness

Description

Computes the skewness.

Usage

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

Arguments

x
a numeric vector containing the values whose skewness 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 skewness detailed below.

Value

  • The estimated skewness of x.

Details

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

Otherwise, write $x_i$ for the non-missing elements of x, $n$ for their number, $\mu$ for their mean, $s$ for their standard deviation, and $m_r = \sum_i (x_i - \mu)^r / n$ for the sample moments of order $r$.

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

[object Object],[object Object],[object Object]

All three skewness measures are 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)
skewness(x)

Run the code above in your browser using DataLab