skewness: Calculate the skewness of a numeric variable.

View source: R/miscellaneous.R

skewnessR Documentation

Calculate the skewness of a numeric variable.

Description

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.

Usage

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.

Author(s)

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

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

Examples

y <- rnorm(1:1000, 100, 15)
skewness(y)


bcgov/elucidate documentation built on Sept. 3, 2022, 7:16 p.m.