skewness calculates the degree of skewness in a numerical distribution. Implements the same functionality as the skewness functions in the psych and e1071 packages for convenience so that those packages are not required as dependencies for elucidate. Unlike the e1071 and psych packages, the elucidate version uses the type 2 calculation as a default since this incorporates a correction for sample size that also matches what is used in SPSS and SAS.

skewness(y, na.rm = TRUE, type = 2)

Arguments

y

a numeric vector/variable.

na.rm

should missing values be removed before attempting to calculate skewness? Default is TRUE.

type

the calculation method you wish to use. See skewness and Joanes & Gill (1998) for details.

References

D. N. Joanes and C. A. Gill (1998), Comparing measures of sample skewness and kurtosis. The Statistician, 47, 183–189.

See also

skewness, skew

Author

Craig P. Hutton, Craig.Hutton@gov.bc.ca

Examples

y <- rnorm(1:1000, 100, 15)
skewness(y)
#> [1] -0.1070297