Skip to contents

Sample Quantiles

Usage

# S4 method for CompositionMatrix
quantile(x, ..., probs = seq(0, 1, 0.25), na.rm = FALSE, names = TRUE)

Arguments

x

A CompositionMatrix object.

...

Currently not used.

probs

A numeric vector of probabilities with values in \([0,1]\).

na.rm

A logical scalar: should missing values be removed?

names

A logical scalar: should results be named?

Value

A numeric matrix.

References

Filzmoser, P., Hron, K. & Reimann, C. (2009). Univariate Statistical Analysis of Environmental (Compositional) Data: Problems and Possibilities. Science of The Total Environment, 407(23): 6100-6108. doi:10.1016/j.scitotenv.2009.08.008 .

See also

Other statistics: aggregate(), condense(), covariance(), dist, mahalanobis(), margin(), mean(), metric_var(), pip(), scale(), variation()

Author

N. Frerebeau

Examples

## Data from Aitchison 1986
data("hongite")

## Coerce to compositional data
coda <- as_composition(hongite)

## Mean
mean(coda)
#>          A          B          C          D          E 
#> 0.48941415 0.21966082 0.09881294 0.10405382 0.08805827 

## Quantile
quantile(coda)
#>          A         B     C     D     E
#> 0%   0.323 0.0520000 0.007 0.055 0.037
#> 25%  0.423 0.1290000 0.038 0.083 0.065
#> 50%  0.452 0.2380000 0.097 0.095 0.085
#> 75%  0.486 0.3233233 0.234 0.109 0.098
#> 100% 0.523 0.4660000 0.429 0.158 0.132

## Metric variance
metric_var(coda)
#> [1] 1.691324

## Metric standard deviation
metric_sd(coda)
#> [1] 0.6502546