Sample moments

Share:

Description

moments provides the estimate of the first 4 moment-statistics of a sample.

Usage

1
2
3
4
 moments (x)
 CV (x)
 skew (x)
 kurt (x)

Arguments

x

vector representing a data-sample

Details

Skewness and kurtosis are defined as:

skew = n^(-1) sd(x)^(-3) sum_i (x_i - mean(x))^3

kurt = n^(-1) sd(x)^(-4) sum_i (x_i - mean(x))^4 - 3

where n is the size of x. See http://en.wikipedia.org/wiki/Skewness and http://en.wikipedia.org/wiki/Kurtosis for additional informations.

Note

For information on the package and the Author, and for all the references, see nsRFA.

See Also

mean, var, sd, Lmoments.

Examples

1
2
3
4
5
6
7
x <- rnorm(30,10,2)
moments(x)

data(hydroSIMN)
x <- annualflows["dato"][,]
cod <- annualflows["cod"][,]
sapply(split(x,cod),moments)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.