Learn R Programming

compositions (version 1.40-2)

mean.acomp: Mean amounts and mean compositions

Description

Compute the mean in the several approaches of compositional and amount data analysis.

Usage

# S3 method for acomp
mean(x,…,robust=getOption("robust"))
          # S3 method for rcomp
mean(x,…,robust=getOption("robust"))
          # S3 method for aplus
mean(x,…,robust=getOption("robust"))
          # S3 method for rplus
mean(x,…,robust=getOption("robust"))
          # S3 method for ccomp
mean(x,…,robust=getOption("robust"))
          # S3 method for rmult
mean(x,…,na.action=NULL,robust=getOption("robust"))

Arguments

x

a classed dataset of amounts or compositions

further arguments to mean e.g. trim

na.action

na.action

robust

A description of a robust estimator. Possible values are FALSE or "pearson" for no robustness, or TRUE or "mcd" for a covMcd based robust location scale estimation. Additional control parameters such as list(trim=0.2) or an rrcov.control object can be given as an attribute "control".

Value

The mean is given as a composition or amount vector of the same class as the original dataset.

Missing Policy

For the additive scales (rcomp,rplus) the SZ and BDT are treated as zeros and MAR and MNAR as missing information. This is not strictly correct for MNAR.

For relative scales (acomp,aplus), all four types of missings are treated as missing information. This corresponds to the idea that BDT are truncated values (and have the correspoding effect in taking means). For SZ and MAR, only the components in the observed subcomposition are fully relevant. Finally, for MNAR the problem is again that nothing could be done without knowing the MNAR mechanism, so the analysis is limited to taking them as MAR, and being careful with the interpretation. Missing and Below Detecion Limit Policy is explained in more detail in compositions.missing.

Details

The different compositional approaches acomp, rcomp, aplus, rplus correpond to different geometries. The mean is calculated in the respective canonical geometry by applying a canonical transform (see cdt), taking ordinary meanCol and backtransforming.

The Aitchison geometries imply that mean.acomp and mean.aplus are geometric means, the first one closed. The real geometry implies that mean.rcomp and mean.rplus are arithmetic means, the first one resulting in a closed composition.

In all cases the mean is again an object of the same class.

See Also

clo, meanCol, geometricmean, acomp, rcomp, aplus, rplus

Examples

Run this code
# NOT RUN {
data(SimulatedAmounts)
meanCol(sa.lognormals)
mean(acomp(sa.lognormals))
mean(rcomp(sa.lognormals))
mean(aplus(sa.lognormals))
mean(rplus(sa.lognormals))
mean(rmult(sa.lognormals))
# }

Run the code above in your browser using DataLab