Learn R Programming

PearsonDS (version 1.3.1)

empMoments: Empirical Moments

Description

Calculates the first four empirical moments (mean, variance, skewness, kurtosis) of a numeric vector.

Usage

empMoments(x)

Value

Named vector of length 4 containing mean, variance,

skewness and kurtosis (in this order).

Arguments

x

(numeric) vector containing the data set.

See Also

PearsonDS-package

Examples

Run this code
## Generate sample with given (theoretical) moments
DATA <- rpearson(25000,moments=c(mean=1,variance=2,skewness=1,kurtosis=5))
## Calculate corresponding empirical moments
empMoments(DATA)

Run the code above in your browser using DataLab