Sample Moments | R Documentation |
Computes the sample skewness and sample kurtosis.
skewness(x, na.rm = FALSE)
kurtosis(x, na.rm = FALSE)
x |
A numeric vector containing the values whose skewness or kurtosis is to be computed. |
na.rm |
A logical value indicating whether |
If N = \mathrm{length}(x)
, then the skewness of
x
is defined as
N^{-1} \mathrm{sd}(x)^{-3} \sum_i (x_i - \mathrm{mean}(x))^3.
If N = \mathrm{length}(x)
, then the kurtosis of
x
is defined as
N^{-1} \mathrm{sd}(x)^{-4}%
\sum_i(x_i - \mathrm{mean}(x))^4 - 3.
The skewness or kurtosis of x
.
These functions and the description of them are taken from the package e1071. They are included to avoid having to require an additional package.
Evgenia Dimitriadou, Kurt Hornik, Friedrich Leisch, David Meyer, and Andreas Weingessel
x <- rnorm(100)
skewness(x)
kurtosis(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.