Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

skewnessandkurtosis

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 are allowed.

na.rm

Logical flag: if na.rm=TRUE, missing values are removed from x before doing the computations. If na.rm=FALSE and x contains missing values, then the return value is NA.

method

Character string specifying the computation method. The two possible values are fisher for Fisher's g1 (skewness) and g2 (kurtosis) versions, and moment for the functional forms of the statistics. Only the first character of the string needs to be supplied.

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^3)/mean(y^2) ^1.5 and the kurtosis value as mean(y^4)/mean(y ^2)^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")

GLDEX

Fitting Single and Mixture of Generalised Lambda Distributions (RS and FMKL) using Various Methods

v2.0.0.7
GPL (>= 3)
Authors
Steve Su, with contributions from: Diethelm Wuertz, Martin Maechler and Rmetrics core team members for low discrepancy algorithm, Juha Karvanen for L moments codes, Robert King for gld C codes and starship codes, Benjamin Dean for corrections and input in ks.gof code and R core team for histsu function.
Initial release
2020-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.