Learn R Programming

parameters (version 0.4.0)

skewness: Compute Skewness and Kurtosis

Description

Compute Skewness and Kurtosis

Usage

skewness(x, na.rm = TRUE, ...)

kurtosis(x, ...)

Arguments

x

A numeric vector or data.frame.

na.rm

Remove missing values.

...

Arguments passed to or from other methods.

Value

Values of skewness or kurtosis.

Details

Skewness

Symmetric distributions have a skewness around zero, while a negative skewness values indicates a "left-skewed" distribution, and a positive skewness values indicates a "right-skewed" distribution. Examples for the relationship of skewness and distributions are:

  • Normal distribution (and other symmetric distribution) has a skewness of 0

  • Half-normal distribution has a skewness just below 1

  • Exponential distribution has a skewness of 2

  • Lognormal distribution can have a skewness of any positive value, depending on its parameters

(https://en.wikipedia.org/wiki/Skewness)

Kurtosis

The kurtosis is a measure of "tailedness" of a distribution. A distribution with a kurtosis values of about zero is called "mesokurtic". A kurtosis value larger than zero indicates a "leptokurtic" distribution with fatter tails. A kurtosis value below zero indicates a "platykurtic" distribution with thinner tails (https://en.wikipedia.org/wiki/Kurtosis).

Examples

Run this code
# NOT RUN {
skewness(rnorm(1000))
kurtosis(rnorm(1000))
# }

Run the code above in your browser using DataLab