skewness: Skewness and Kurtosis

View source: R/skewness.R

skewnessR Documentation

Skewness and Kurtosis

Description

The function skewness computes the skewness, the function kurtosis computes the kurtosis.

Usage

skewness(..., data = NULL, as.na = NULL, check = TRUE)

kurtosis(..., data = NULL, as.na = NULL, check = TRUE)

Arguments

...

a numeric vector. Alternatively, an expression indicating the variable names in data e.g., skewness(x1, data = dat).

data

a data frame when specifying the variable in the argument .... Note that the argument is NULL when specifying a numeric vector for the argument ....

as.na

a numeric vector indicating user-defined missing values, i.e. these values are converted to NA before conducting the analysis.

check

logical: if TRUE (default), argument specification is checked.

Details

The same method for estimating skewness and kurtosis is used in SAS and SPSS. Missing values (NA) are stripped before the computation. Note that at least 3 observations are needed to compute skewness and at least 4 observations are needed to compute excess kurtosis.

Value

Returns the estimated skewness or kurtosis of x.

Author(s)

Takuya Yanagida takuya.yanagida@univie.ac.at

References

Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. New York: John Wiley & Sons.

See Also

descript

Examples

# Set seed of the random number generation
set.seed(123)
# Generate random numbers according to N(0, 1)
x <- rnorm(100)

# Example 1: Compute skewness
skewness(x)

# Example 2: Compute excess kurtosis
kurtosis(x)

misty documentation built on Oct. 24, 2024, 5:10 p.m.

Related to skewness in misty...