variance | R Documentation |
Computes log-ratio (weighted) variances.
variance(x, ...)
## S4 method for signature 'LogRatio'
variance(x, row_weights = NULL, column_weights = TRUE)
x |
A |
... |
Currently not used. |
row_weights |
A |
column_weights |
A |
A numeric
vector of individual variances.
N. Frerebeau
Greenacre, M. J. (2019). Compositional Data Analysis in Practice. Boca Raton: CRC Press.
Other statistics:
aggregate()
,
condense()
,
covariance()
,
dist
,
mahalanobis()
,
margin()
,
mean()
,
pip()
,
quantile()
,
scale()
,
variance_total()
,
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.