Learn R Programming

MSMU (version 0.1.2)

kurt: Compute Sample Kurtosis

Description

Calculates the kurtosis of a numeric vector. A value near 0 suggests normal kurtosis (mesokurtic), positive values indicate heavier tails (leptokurtic), and negative values indicate lighter tails (platykurtic).

Usage

kurt(x)

Value

A single numeric value representing the kurtosis

Arguments

x

A numeric vector.

Details

The z-scores are computed as: $$z_i = \frac{x_i - \bar{x}}{sd}$$

The kurtosis is then calculated as: $$\text{Kurtosis} = \frac{1}{n} \sum_{i=1}^{n} z_i^4 - 3$$

Where:

  • \(\bar{x}\) is the mean of \(x\),

  • \(sd\) is the standard deviation of \(x\),

  • and \(n\) is the number of observations.

Examples

Run this code
# Kurtosis of mpg in mtcars
data("mtcars")
kurt(mtcars$mpg)


Run the code above in your browser using DataLab