Package 'cumstats'

Title: Cumulative Descriptive Statistics
Description: Cumulative descriptive statistics for (arithmetic, geometric, harmonic) mean, median, mode, variance, skewness and kurtosis.
Authors: Arturo Erdely and Ian Castillo
Maintainer: Arturo Erdely <[email protected]>
License: GPL-3
Version: 1.0
Built: 2024-11-07 06:27:29 UTC
Source: CRAN

Help Index


Cumulative Descriptive Statistics

Description

Cumulative descriptive statistics for (arithmetic, geometric, harmonic) mean, median, mode, variance, skewness and kurtosis.

Details

The DESCRIPTION file:

Package: cumstats
Type: Package
Title: Cumulative Descriptive Statistics
Version: 1.0
Date: 2017-01-13
Author: Arturo Erdely and Ian Castillo
Maintainer: Arturo Erdely <[email protected]>
Description: Cumulative descriptive statistics for (arithmetic, geometric, harmonic) mean, median, mode, variance, skewness and kurtosis.
License: GPL-3
NeedsCompilation: no
Packaged: 2017-01-15 23:19:59 UTC; aerde
Repository: CRAN
Date/Publication: 2017-01-16 08:13:00

Index of help topics:

Mode                    Statistical Mode
cumgmean                Cumulative Geometric Mean
cumhmean                Cumulative Harmonic Mean
cumkurt                 Cumulative Kurtosis
cummean                 Cumulative Arithmetic Mean
cummedian               Cumulative Median
cummode                 Cumulative Mode
cumquant                Cumulative Quantile
cumskew                 Cumulative Skewness
cumstats-package        Cumulative Descriptive Statistics
cumvar                  Cumulative Variance
kurtosis                Pearson's Measure of Kurtosis
skewness                Skewness

Cumulative descriptive statistics for (arithmetic, geometric, harmonic) mean, median, mode, variance, skewness and kurtosis.

Author(s)

Arturo Erdely and Ian Castillo

Maintainer: Arturo Erdely <[email protected]>


Cumulative Geometric Mean

Description

Returns a vector whose elements are the cumulative geometric mean of the elements of the argument.

Usage

cumgmean(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.

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.

See Also

cumhmean, cummean

Examples

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

z <- cumgmean(rlnorm(10000, 0, 1))
head(z); tail(z)

Cumulative Harmonic Mean

Description

Returns a vector whose elements are the cumulative harmonic mean of the elements of the argument.

Usage

cumhmean(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.

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.

See Also

cumgmean, cummean

Examples

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

Cumulative Kurtosis

Description

Returns a vector whose elements are the cumulative kurtosis of the elements of the argument.

Usage

cumkurt(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 NaN since kurtosis requires at least two different 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.

See Also

kurtosis

Examples

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

Cumulative Arithmetic Mean

Description

Returns a vector whose elements are the cumulative arithmetic mean of the elements of the argument.

Usage

cummean(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.

Author(s)

Arturo Erdely and Ian Castillo.

References

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

See Also

cumhmean, cumgmean, cummedian

Examples

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

Cumulative Median

Description

Returns a vector whose elements are the cumulative median of the elements of the argument.

Usage

cummedian(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.

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.

See Also

cummean, cumquant

Examples

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

Cumulative Mode

Description

Returns a list whose elements are the cumulative statistical mode(s) of the elements of the argument.

Usage

cummode(x)

Arguments

x

a numeric vector.

Value

A list of the same length as x with numeric vectors. NA values are also counted.

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.

See Also

Mode

Examples

cummode(c(rep(1, 2), rep(12, 5), rep(44, 3), rep(8, 5), 55))

cummode(c(rep(1, 2), rep(12, 5), rep(44, 3), rep(8, 5), rep(NA, 7), 55))

cummode(runif(5))

cummode(c(rep("a", 2), rep("b", 5), rep("d", 3), rep("e", 5), rep(NA, 5)))

Cumulative Quantile

Description

Returns a vector whose elements are the cumulative quantile of the elements of the argument.

Usage

cumquant(x, p, type = 7)

Arguments

x

a numeric vector.

p

probability for the desired quantile.

type

See quantile in R base package.

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.

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.

See Also

cummedian

Examples

y <- c(9, 1, 3, 0, NA, 2, 5)
cummedian(y)
cumquant(y, 0.5)

z <- cumquant(rcauchy(10000), 0.75)
head(z); tail(z)

Cumulative Skewness

Description

Returns a vector whose elements are the cumulative skewness of the elements of the argument.

Usage

cumskew(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 NaN since skewness requires at least two different 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.

See Also

skewness

Examples

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

Cumulative Variance

Description

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

Usage

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

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

Pearson's Measure of Kurtosis

Description

This function computes the estimator of Pearson's measure of kurtosis.

Usage

kurtosis(x)

Arguments

x

a numeric vector.

Value

A numeric value of skewness. Returns NA if x contains NA value(s), and NaN if length(unique(x))==1 is TRUE.

Author(s)

Adapted by Arturo Erdely from moments R package by Lukasz Komsta.

References

Komsta, L. and Novomestky, F. (2015). moments: Moments, cumulants, skewness, kurtosis and related tests. R package version 0.14. https://CRAN.R-project.org/package=moments

See Also

cumkurt

Examples

kurtosis(c(9, 1, 3, 0))

Statistical Mode

Description

This function computes the statistical mode of given data.

Usage

Mode(x)

Arguments

x

a numeric or character vector.

Value

A list containing the following components:

Values

of statistical mode(s) found, in the order they appear in x

Frequency

number of times the mode(s) appear in x

NA values are also considered.

Author(s)

Ian Castillo.

References

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

See Also

cummode

Examples

Mode(c(rep(1, 2), rep(12, 5), rep(44, 3), rep(8, 5), 55))

Mode(c(rep(1, 2), rep(12, 5), rep(44, 3), rep(8, 5), rep(NA, 7), 55))

Mode(runif(5))

Mode(c(rep("a", 2), rep("b", 5), rep("d", 3), rep("e", 5), rep(NA, 5)))

Skewness

Description

This function computes skewness of given numeric data.

Usage

skewness(x)

Arguments

x

a numeric vector.

Value

A numeric value of skewness. Returns NA if x contains NA value(s), and NaN if length(unique(x))==1 is TRUE.

Author(s)

Adapted by Arturo Erdely from moments R package by Lukasz Komsta.

References

Komsta, L. and Novomestky, F. (2015). moments: Moments, cumulants, skewness, kurtosis and related tests. R package version 0.14. https://CRAN.R-project.org/package=moments

See Also

cumskew

Examples

skewness(c(9, 1, 3, 0))