R: Skewness

skewness {modeest} | R Documentation

## Skewness

### Description

The `skewness.default` function from package fBasics is completed in order to implement Bickel's measure of skewness, based on the mode of the distribution considered.

### Usage

    skewness(x,
             ...)

      ## Default S3 method:
    skewness(x,
             na.rm = FALSE,
             method = c("moment", "fisher", "bickel"),
             M = shorth(x),
             ...)

### Arguments

`x` | numeric. Vector of observations.
`na.rm` | logical. Should missing values be removed?
`method` | character. Specifies the method of computation. These are either `"moment"`, `"fisher"` or `"bickel"`. The `"moment"` method is based on the definition of skewness for distributions; this form should be used when resampling (bootstrap or jackknife). The `"fisher"` method corresponds to the usual "unbiased" definition of sample variance, although in the case of skewness exact unbiasedness is not possible.
`M` | numeric. (An estimate of) the mode of the observations `x`. Default value is `shorth(x)`.
`...` | arguments to be passed.

### Value

`skewness` returns a numeric value. An attribute which reports the method used is added.

### Author(s)

Diethelm Wuertz and other authors for the original `skewness` function from package fBasics;
P. Poncet for the slight modification introduced.

### References

- Bickel D.R. (2002). Robust estimators of the mode and skewness of continuous data. Computational Statistics and Data Analysis, 39:153-163.

- Bickel D.R. et Fruehwirth R. (2006). On a Fast, Robust Estimator of the Mode: Comparisons to Other Robust Estimators with Applications. Computational Statistics and Data Analysis, 50(12):3500-3530.

### See Also

package fBasics; `mlv` for general mode estimation; `shorth` for the shorth estimate of the mode

### Examples

    ## Skewness = 0
    x <- rnorm(1000)
    skewness(x, method = "bickel", M = shorth(x))

    ## Skewness > 0 (left skewed case)
    x <- rbeta(1000, 2, 5)
    skewness(x, method = "bickel", M = betaMode(2, 5))

    ## Skewness < 0 (right skewed case)
    x <- rbeta(1000, 7, 2)
    skewness(x, method = "bickel", M = hsm(x, bw = 1/3))

[Package modeest version 2.1 Index]