kurtosis | R Documentation |
Computes the kurtosis.
kurtosis(x, na.rm = FALSE, type = 3)
x |
a numeric vector containing the values whose kurtosis is to be computed. |
na.rm |
a logical value indicating whether |
type |
an integer between 1 and 3 selecting one of the algorithms for computing kurtosis detailed below. |
If x
contains missings and these are not removed, the kurtosis
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 kurtosis:
g_2 = m_4 / m_2^2 - 3
.
This is the typical definition used in many older textbooks.
G_2 = ((n+1) g_2 + 6) * (n-1) / ((n-2)(n-3))
.
Used in SAS and SPSS.
b_2 = m_4 / s^4 - 3 = (g_2 + 3) (1 - 1/n)^2 - 3
.
Used in MINITAB and BMDP.
Only G_2
(corresponding to type = 2
) is unbiased under
normality.
The estimated kurtosis of x
.
D. N. Joanes and C. A. Gill (1998), Comparing measures of sample skewness and kurtosis. The Statistician, 47, 183–189.
x <- rnorm(100)
kurtosis(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.