LR.VAR | R Documentation |
Computation of total (weighted)logratio variance.
LR.VAR(LRdata, row.wt = NA, weight=TRUE, vars=FALSE)
LRdata |
Matrix of logratios, either a vector or preferably the logratio object resulting from one of the functions ALR, CLR, PLR or LR |
row.wt |
Optional set of row weights (default: equal weights) |
weight |
Logical indicating if varying weights are returned(default: |
vars |
If |
The function LR.VAR
computes the sum of the logratio variances provided as input, using the weights in the logratio data object.
LRtotvar |
The total logratio variance |
LRvars |
(optional, if vars=TRUE, the individual logratio variances composing the total) |
Michael Greenacre
Aitchison, J. (1986), The Statistical Analysis of Compositional Data, Chapman & Hall.
Greenacre, M. (2018), Compositional Data Analysis in Practice, Chapman & Hall / CRC Press.
LR
, ALR
, invALR
, CLR
, invCLR
data(cups)
# These give identical total logratio variances (weighted, by default)
LR.VAR(CLR(cups))
LR.VAR(LR(cups))
# Summing over all sets of ALRs gives twice the variance
totvar <- 0
for(j in 1:ncol(cups)) totvar <- totvar + LR.VAR(ALR(cups, denom=j))
totvar/2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.