Learn R Programming

asbio (version 0.2-1)

skew: 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"

Value

  • Output will be the sample skewness or kurtosis.

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 $\gamma_1$ and $\gamma_2$ respectively. For a symmetric distribution skewness will equal zero; i.e. $\gamma_1$ = 0. A distribution with more density in its right-hand tail will have $\gamma_1$ > 0, while one with more density in its left-hand tail will have $\gamma_1$ < 0. These distributions are often referred to as positively-skewed and negatively-skewed respectively. If a distribution is normally peaked (mesokurtic) then $\gamma_2$ = 3. As a result the number three is generally subtracted from kurtosis estimates so that a normal distribution will have $\gamma_2$ = 0 . Thus strongly peaked (leptokurtotic) distributions will have $\gamma_2$ > 0, while flat-looking (platykurtotic) distributions will have a kurtosis $\gamma_2$ < 0. Several types of skewness and kurtosis estimation are possible. For method of moments estimation let: $$m_i = (1/n)\sum_i{X_i-\bar{X}}^i,$$

then the method of moments skewness is: $m_3/m_{2}^{3/2}$, the method of moments kurtosis is: $m_4/m_2^2$, and the excess method of moments kurtosis is $m_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.

Examples

Run this code
exp<-rexp(10000)
skew(exp)
kurt(exp)

Run the code above in your browser using DataLab