variance_total | R Documentation |
Computes the total (or metric) variance, a global measure of spread.
variance_total(x, ...)
## S4 method for signature 'CompositionMatrix'
variance_total(x, sd = FALSE)
## S4 method for signature 'LogRatio'
variance_total(x, row_weights = NULL, column_weights = TRUE)
x |
A |
... |
Currently not used. |
sd |
A |
row_weights |
A |
column_weights |
A |
Two methods are available, see below.
A numeric
vector.
variance_total(CompositionMatrix)
: The total variance of compositional data is the
trace of the centred log-ratio covariance matrix
(i.e. totvar1 in Aitchison 1997).
variance_total(LogRatio)
: Computes the total log-ratio variance. This is
identical to the weighted sum-of-squared distances between samples
(i.e. totvar2 in Aitchison 1997).
N. Frerebeau
Aitchison, J. (1986). The Statistical Analysis of Compositional Data. London: Chapman and Hall, p. 64-91.
Aitchison, J. (1997). The One-Hour Course in Compositional Data Analysis or Compositional Data Analysis Is Simple. In V. Pawlowsky-Glahn (ed.), IAMG'97. Barcelona: International Center for Numerical Methods in Engineering (CIMNE), p. 3-35.
Boogaart, K. G. van den & Tolosana-Delgado, R. (2013). Analyzing Compositional Data with R. Berlin Heidelberg: Springer-Verlag. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-642-36809-7")}.
Greenacre, M. J. (2019). Compositional Data Analysis in Practice. Boca Raton: CRC Press.
Hron, K. & Kubáček. L. (2011). Statistical Properties of the Total Variation Estimator for Compositional Data. Metrika, 74 (2): 221-230. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s00184-010-0299-3")}.
Pawlowsky-Glahn, V. & Egozcue, J. J. (2001). Geometric Approach to Statistical Analysis on the Simplex. Stochastic Environmental Research and Risk Assessment, 15(5): 384-398. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s004770100077")}.
Other statistics:
aggregate()
,
condense()
,
covariance()
,
dist
,
mahalanobis()
,
margin()
,
mean()
,
pip()
,
quantile()
,
scale()
,
variance()
,
variation()
## Data from Aitchison 1986
data("hongite")
## Coerce to compositional data
coda <- as_composition(hongite)
## Total variance (1)
variance_total(coda)
## Metric standard deviation
variance_total(coda, sd = TRUE)
## CLR transformation
clr <- transform_clr(coda)
## Individual log-ratio variances
variance(clr)
## Total log-ratio variance (2)
variance_total(clr)
## Proportionality between (1) and (2)
## See Aitchison 1997
variance_total(coda) * (1 / ncol(coda)) * (1 - (1 / nrow(coda)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.