LR.VAR: Total logratio variance

LR.VARR Documentation

Total logratio variance

Description

Computation of total (weighted)logratio variance.

Usage

LR.VAR(LRdata, row.wt = NA, weight=FALSE, vars=FALSE)

Arguments

LRdata

Matrix of logratios, either a vector or preferably the logratio object resulting from one of the functions ALR, CLR or PLR

row.wt

Optional set of row weights (default: equal weights)

weight

Logical indicating if parts are weighted or not (default: FALSE for unweighted (i.e., equal weights)). If TRUE, parts are weighted by compositional means. Alternatively a set of positive weights can be specified.

vars

If TRUE, output individual variances as well (default: FALSE)

Details

The function LR.VAR computes the sum of the logratio variances provided as input, using the weights in the logratio data object.

Value

LRtotvar

The total logratio variance

LRvars

(optional, if vars=TRUE, the individual logratio variances composing the total)

Author(s)

Michael Greenacre

References

Aitchison, J. (1986), The Statistical Analysis of Compositional Data, Chapman & Hall.
Greenacre, M. (2018, 2026), Compositional Data Analysis in Practice, 1st and 2nd editions, Chapman & Hall / CRC Press.

See Also

PLR, ALR, CLR

Examples

data(RomanCups)
# These give identical total weighted logratio variances
LR.VAR(CLR(RomanCups, weight=TRUE))
LR.VAR(PLR(RomanCups, weight=TRUE))
# Summing over all sets of ALRs gives twice the total variance
totvar <- 0
for(j in 1:ncol(RomanCups)) 
    totvar <- totvar + suppressMessages(LR.VAR(ALR(RomanCups, denom=j, weight=TRUE)))
totvar/2

easyCODA documentation built on Nov. 24, 2026, 1:07 a.m.

Related to LR.VAR in easyCODA...