Learn R Programming

CoSMoS (version 2.2.0)

sample.moments: Sample moments

Description

Computes raw moments, central moments, and standardised coefficients (CV, skewness, kurtosis) from a numeric sample.

Usage

sample.moments(
  x,
  na.rm = FALSE,
  raw = TRUE,
  central = TRUE,
  coef = TRUE,
  order = 1:4
)

Value

a named list with zero or more of:

m

raw moments

mu

central moments

coefficients

CV, skewness, kurtosis

Arguments

x

numeric vector of values

na.rm

logical; strip NA values before computation?

raw

logical; compute raw moments?

central

logical; compute central moments?

coef

logical; compute standardised coefficients (CV, skewness, kurtosis)?

order

integer vector; raw moment orders (default 1:4)

See Also

moments, checkTS

Examples

Run this code

library(CoSMoS)

x <- rnorm(1000)
sample.moments(x)

y <- rparetoII(1000, 10, .1)
sample.moments(y)

Run the code above in your browser using DataLab