cumvar: Cumulative Variance

Description Usage Arguments Value Author(s) References Examples

Description

Returns a vector whose elements are the cumulative sample variance of the elements of the argument.

Usage

1
cumvar(x)

Arguments

x

a numeric vector.

Value

A numeric vector of the same length as x. An NA value in x causes the corresponding and following elements of the return value to be NA. The first entry is always NA since sample variance requires at least two values.

Author(s)

Arturo Erdely.

References

Kotz, S., Balakrishnan, N., Read, C.B, Vidakovic, B., Johnson, N.L. (2006) Encyclopedia of Statistical Sciences. Wiley, New Jersey.

Examples

1
cumvar(c(9, 1, 4, 0, 3, NA, 8, 5))

Example output

[1]       NA 32.00000 16.33333 16.33333 12.30000       NA       NA       NA

cumstats documentation built on May 2, 2019, 3:04 a.m.