LRA: Logratio analysis

View source: R/LRA.r

LRAR Documentation

Logratio analysis

Description

Computation of weighted or unweighted logratio analysis of a samples-by-parts compositional data table.

Usage

LRA(data, nd = 2, weight = TRUE, suprow = NA, row.wt = NA, amalg = NA, supamalg = FALSE)

Arguments

data

A data frame or matrix of compositional data, with no zero values

nd

Number of dimensions for summary solution if not 2 (default)

weight

TRUE (default) for part weighting, FALSE for unweighted analysis, or a vector of user-defined part weights

suprow

Indices of rows that are supplementary points

row.wt

Optional user-defined set of positive weights for the rows (samples) (default: equal weights)

amalg

Optional list of amalgamated parts

supamalg

FALSE (default) when amalgamations are active and their subparts supplementary, TRUE when amalgamations are supplementary and their parts active

Details

The function LRA computes a log-ratio analysis of a table of compositional data based on the singular value decomposition. By default the weighted log-ratio analysis is computed (Greenacre & Lewi 2009). For the unweighted logratio analysis (Aitchison & Greenacre 2002), specify the option weight=FALSE.

User-specified weights can be supplied, for the rows and/or the columns. Usually row weights are not specified, and are equal unless intentional weighting of the samples is desired. Default column weights (if weight = TRUE) are the part means of the true compositional table, thus summing to 1. User-specified part weights can be provided using the same weight option.

Supplementary rows can be declared (also known as passive points) – these do not contribute to the solution but are positioned on the solution axes.

Amalgamations can be defined and can either replace their constituent parts (default) or be declared supplementary using the supamalg option: supamalg = FALSE (default), = TRUE if all declared amalgamations are supplementary.

The function borrows the structure and functions of the ca package, which is required, and produces a ca object, and the same print, summary and plot methods can be used, as for a ca object.

Value

sv

Singular values

nd

Number of dimensions in solution results

rownames

Row names

rowmass

Row weights

rowdist

Row logratio distances to centroid

rowinertia

Row inertias

rowcoord

Row standard coordinates

rowpcoord

Row principal coordinates

rowsup

Indices of row supplementary points

colnames

Column names

colmass

Column weights

coldist

Column logratio distances to centroid

colinertia

Column inertias

colcoord

Column standard coordinates

colpcoord

Column principal coordinates

N

The compositional data table

Author(s)

Michael Greenacre

References

Aitchison, J. and Greenacre, M. (2002), Biplots of compositional data, Applied Statistics 51, 375-392.
Greenacre, M. and Lewi, P.J. (2009), Distributional equivalence and subcompositional coherence in the analysis of compositional data, contingency tables and ratio scale measurements. Journal of Classification 26, 29-54. Greenacre, M. (2020), Amalgamations are valid in compositional data analysis, can be used in agglomerative clustering, and their logratios have an inverse transformation. Applied Computing and Geosciences 5, 100017.

See Also

plot.ca, summary.ca, print.ca

Examples

# (weighted) LRA of the RomanCups data set, showing default symmetric map
data("cups")
PLOT.LRA(LRA(cups))
# (unweighted) LRA of the RomanCups data set, showing default symmetric map
# the solution is completely different
PLOT.LRA(LRA(cups, weight=FALSE))

easyCODA documentation built on Aug. 26, 2024, 3 p.m.