skew {asbio}R Documentation

Sample skewness and kurtosis

Description

Functions for skewness and kurtosis.

Usage


skew(x,method="unbiased")

kurt(x,method="unbiased")

Arguments

x

A vector of quantitative data.

method

The type of method used for computation of skew and kurtosis. Two choices are possible for skewness: "moments" and "unbiased", and three choices are possible for kurtosis: "unbiased", "moments", and "excess".

Details

Aside from centrality and variability we can describe distributions with respect to their shape. Two important shape descriptors are skewness and kurtosis. Skewness describes the relative density in the tails of a distribution while kurtosis describes the peakedness of a distribution. When quantified for a population skewness and kurtosis are denoted as γ1\gamma_1 and γ2\gamma_2 respectively. For a symmetric distribution skewness will equal zero; i.e. γ1\gamma_1 = 0. A distribution with more density in its right-hand tail will have γ1\gamma_1 > 0, while one with more density in its left-hand tail will have γ1\gamma_1 < 0. These distributions are often referred to as positively-skewed and negatively-skewed respectively. If a distribution is normally peaked (mesokurtic) then γ2\gamma_2 = 3. As a result the number three is generally subtracted from kurtosis estimates so that a normal distribution will have γ2\gamma_2 = 0 . Thus strongly peaked (leptokurtic) distributions will have γ2\gamma_2 > 0, while flat-looking (platykurtic) distributions will have a kurtosis γ2\gamma_2 < 0.

Several types of skewness and kurtosis estimation are possible.

For method of moments estimation let:

mj=(1/n)i(XiXˉ)j,m_j = (1/n)\sum_i({X_i-\bar{X}})^j,

then the method of moments skewness is: m3/m23/2m_3/m_{2}^{3/2}, the method of moments kurtosis is: m4/m22m_4/m_2^2, and the excess method of moments kurtosis is m4/m223m_4/m_2^2 -3.

These estimators are biased low, particularly given small sample sizes. A more complex estimator is required to account for this bias. This is provided by method = "unbiased" in skew and kurt.

Value

Output will be the sample skewness or kurtosis.

Author(s)

Ken Aho

Examples

exp<-rexp(10000)
skew(exp)
kurt(exp)

[Package asbio version 1.9-7 Index]