Learn R Programming

confintr (version 0.2.0)

moments: Moments

Description

Functions to calculate moments, skewness, and Pearson's measure of kurtosis. The latter is defined as the ratio of the 4th central moment and the squared second central moment. For a theoretical normal distribution, the kurtosis equals 3.

Usage

moment(z, p = 1, central = TRUE, na.rm = TRUE)

skewness(z, na.rm = TRUE)

kurtosis(z, na.rm = TRUE)

Value

A numeric vector of length one.

Arguments

z

Numeric vector.

p

Order of moment.

central

Should central moment be calculated? Default is TRUE.

na.rm

Should missing values be removed? Default is TRUE. Otherwise, the result will be NA if missing values are present.

Examples

Run this code
x <- 1:100
moment(x, 4)
skewness(x)
kurtosis(x)

Run the code above in your browser using DataLab