skewness and kurtosis {GLDEX} | R Documentation |
Compute skewness and kurtosis statistics
Description
This uses the S+ version directly.
Usage
skewness(x, na.rm = FALSE, method = "fisher")
kurtosis(x, na.rm = FALSE, method = "fisher")
Arguments
x |
Any numerical object. Missing values |
na.rm |
Logical flag: if na.rm=TRUE, missing values are removed from x
before doing the computations. If |
method |
Character string specifying the computation method. The two
possible values are |
Details
The moment
forms are based on the definitions of skewness and kurtosis
for distributions; these forms should be used when resampling (bootstrap or
jackknife). The "fisher" forms correspond to the usual "unbiased" definition of
sample variance, though in the case of skewness and kurtosis exact unbiasedness
is not possible.
Value
A single value of skewness or kurtotis.
If y = x - mean(x), then the "moment" method computes the skewness value as
mean(y\mbox{\textasciitilde}
3)/mean(y\mbox{\textasciitilde}
2)
\mbox{\textasciitilde}
1.5
and the kurtosis value as mean(y\mbox{\textasciitilde}
4)/mean(y
\mbox{\textasciitilde}
2)\mbox{\textasciitilde}
2 - 3.
To see the "fisher" calculations, print out the functions.
Author(s)
Splus
See Also
var
Examples
x <- runif(30)
skewness(x)
skewness(x, method="moment")
kurtosis(x)
kurtosis(x, method="moment")