moment {stats} R Documentation

Statistical Moments

Description


This function computes the sample moment of specified order.

Usage

moment(x,
    order = 1,
    central = FALSE,
    absolute = FALSE,
    na.rm = FALSE);

Arguments

x

a numeric vector of data.

order

order of the moment to be computed. [as integer]

central

a logical value - if central moments are to be computed. [as boolean]

absolute

a logical value - if absolute moments are to be computed. [as boolean]

na.rm

a logical value - remove NA values?. [as boolean]

env

[as Environment]

Details

Authors

sciBASIC.NET

Value

this function returns data object of type any kind.

clr value class

Examples

 let data = c(2, 4, 4, 4, 5, 5, 7, 9);
 
 moment(data, 2);
 # [1]  29
 moment(data, 2, central=TRUE);
 # [1]  4
 
 moment(data, 3);
 # [1]  190.25
 moment(data, 3, central=TRUE);
 # [1]  5.25

[Package stats version 5.0.1.2389 Index]