Computation of weighted or unweighted logratio analysis of a samples-by-parts compositional data table.
LRA(data, nd = 2, weight = TRUE, suprow = NA, row.wt = NA, amalg = NA, supamalg = FALSE)
Singular values
Number of dimensions in solution results
Row names
Row weights
Row logratio distances to centroid
Row inertias
Row standard coordinates
Row principal coordinates
Indices of row supplementary points
Column names
Column weights
Column logratio distances to centroid
Column inertias
Column standard coordinates
Column principal coordinates
The compositional data table
A data frame or matrix of compositional data, with no zero values
Number of dimensions for summary solution if not 2 (default)
TRUE (default) for part weighting, FALSE for unweighted analysis, or a vector of user-defined part weights
Indices of rows that are supplementary points
Optional user-defined set of positive weights for the rows (samples) (default: equal weights)
Optional list of amalgamated parts
FALSE (default) when amalgamations are active and their subparts supplementary, TRUE when amalgamations are supplementary and their parts active
Michael Greenacre
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.
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.
plot.ca
, summary.ca
, print.ca
# (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))
Run the code above in your browser using DataLab