Learn R Programming

rgr (version 1.1.15)

alr: Additive Log-Ratio (alr) transformation

Description

Undertakes an additive log-ratio transformation to remove the effects of closure in a data matrix.

Usage

alr(xx, j = NULL, ifclose = FALSE, ifwarn = TRUE)

Arguments

xx

a n by p matrix to be additively log ratioed. It is essential that a single unit of measurement is used. Thus it may be required to convert, for example, determinations in percent to ppm (mg/kg) so that all measurements are in ppm prior to executing this function. Natural logarithms are used.

j

the index number of the element in the range [1:p] to be used as the divisor, j, must be defined, there is no default index.

ifclose

if it is required to close a data set prior to transformation set ifclose = TRUE.

ifwarn

by default ifwarn = TRUE which generates a reminder/warning that when carrying out an additive log-ratio transformation all the data/parts must be in the same measurement units. The message can be suppressed by setting ifwarn = FALSE.

Value

x

a n by (p-1) matrix of additively log-ratioed values, the j-th column of the matrix being dropped.

Details

Most analytical chemical data for major, minor and trace elements are of a closed form, i.e. for a physical individual sample they sum to a constant, whether it be percent, ppm (mg/kg), or some other units. It does not matter that only some components contributing to the constant sum are present in the matrix, the data are closed. As a result, as some elements increase in concentration others must decrease, this leads to correlation measures and graphical presentations that do not reflect the true underlying relationships. An additive log-ratio is one procedure for removing closure effects, others are centred log-ratios (clr) and isometric log-ratios (ilr).

Care should be taken in selecting the variable, index = j, for use as the divisor. Variables lacking sufficient significant figures in their quantification, or variables measured at close to their measurement detection limits, should be avoided.

The name of the divisor, j, retrieved from the matrix column names is displayed.

It is worth noting that when the alr transform is undertaken with a geochemically conservative element selected as the divisor and two elements are then displayed in an x-y plot the result is a Pearce Element Ratio plot (Pearce, 1968) with log scaling.

References

Aitchison, J., 1984. The statistical analysis of geochemical compositions. Mathematical Geology, 16(6):531-564.

Aitchison, J., 1986. The Statistical Analysis of Compositional data. Chapman and Hall, London, U.K., 416 p.

Aitchison, J. and Egozcue, J.J., 2005. Compositional data analysis; where are we and where should we be heading. Mathematical Geology, 37(7):829-850.

Buccianti, A., Mateu-Figueras, G, and Pawlowsky-Glahn, V. (eds.), 2006. Compositional data analysis in the geosciences: from theory to practice. The Geological Society Publishing House, Bath, U.K. Special Publication 264, 224 p.

Pearce, T.H., 1968. A contribution to the theory of variation diagrams. Contributions to Mineralogy and Petrolgy, 19(2):142-157.

Reimann, C., Filzmoser, P., Garrett, R. and Dutter, R., 2008. Statistical Data Analysis Explained: Applied Environmental Statistics with R. Wiley, 362 p.

See Also

clr, ilr, ltdl.fix.df, remove.na

Examples

Run this code
# NOT RUN {
## Make test data available
data(sind)
sind.mat <- as.matrix(sind[, -c(1:3)])

## Undertake alr transform, use Pb [j = 6] as the divisor,
## note necessity of converting percent Fe to mg/kg
sind.mat[, 2] <- sind.mat[, 2] * 10000
temp <- alr(sind.mat, 6)
temp

## Clean-up
rm(sind.mat)
rm(temp)
# }

Run the code above in your browser using DataLab