Calculate kurtosis of the sample using a formula for either the (1) biased estimator or (2) an unbiased estimator of the population kurtosis. Formulas were taken from DeCarlo (1997), tools:::Rd_expr_doi("10.1037/1082-989X.2.3.292")
kurtosis(vector =NULL, unbiased =TRUE)
Arguments
vector: a numeric vector
unbiased: logical. If unbiased = TRUE, the unbiased estimate of the population kurtosis will be calculated. If unbiased = FALSE, the biased estimate of the population kurtosis will be calculated. By default, unbiase = TRUE.
Returns
a numeric value, i.e., kurtosis of the given vector
Examples
# calculate the unbiased estimator (e.g., kurtosis value that# Excel 2016 will produce)kim::kurtosis(c(1,2,3,4,5,10))# calculate the biased estimator (e.g., kurtosis value that# R Package 'moments' will produce)kim::kurtosis(c(1,2,3,4,5,10), unbiased =FALSE)# compare with kurtosis from 'moments' packagemoments::kurtosis(c(1,2,3,4,5,10))