Learn R Programming

CoSMoS (version 2.1.2)

sample.moments: Estimation of sample moments

Description

Estimation of sample moments.

Usage

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

Arguments

x

a numeric vector of values

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds

raw

logical - calculate raw moments?

central

logical - calculate central moments?

coef

logical - calculate coefficients (coefficient of variation, skewness and kurtosis)?

order

vector of integers - raw moment orders

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