sampleMoments function

Sample Skewness and Kurtosis

Sample Skewness and Kurtosis

Computes the sample skewness and sample kurtosis.

skewness(x, na.rm = FALSE) kurtosis(x, na.rm = FALSE)

Arguments

  • x: A numeric vector containing the values whose skewness or kurtosis is to be computed.
  • na.rm: A logical value indicating whether NA values should be stripped before the computation proceeds.

Details

If N=length(x)N = length(x), then the skewness of xx is defined as

N1sd(x)3i(ximean(x))3. N^{-1} \mathrm{sd}(x)^{-3} \sum_i (x_i - \mathrm{mean}(x))^3.%N^(-1) sd(x)^(-3) sum_i (x_i - mean(x))^3.

If N=length(x)N = length(x), then the kurtosis of xx is defined as

N1sd(x)4 N^{-1} \mathrm{sd}(x)^{-4}%\sum_i(x_i - \mathrm{mean}(x))^4 - 3.%N^(-1) sd(x)^(-4) sum_i (x_i - mean(x))^4 - 3.

Returns

The skewness or kurtosis of x.

Note

These functions and the description of them are taken from the package e1071. They are included to avoid having to require an additional package.

Author(s)

Evgenia Dimitriadou, Kurt Hornik, Friedrich Leisch, David Meyer, and Andreas Weingessel

Examples

x <- rnorm(100) skewness(x) kurtosis(x)
  • Maintainer: David Scott
  • License: GPL (>= 2)
  • Last published: 2025-03-29

Useful links