Compute the mean in the several approaches of compositional and amount data analysis.
# 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"))
The mean is given as a composition or amount vector of the same class as the original dataset.
a classed dataset of amounts or compositions
further arguments to mean
e.g. trim
na.action
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".
K.Gerald v.d. Boogaart http://www.stat.boogaart.de
For the additive scales (rcomp,rplus) the SZ and BDL 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 BDL 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.
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.
clo
, meanCol
,
geometricmean
, acomp
,
rcomp
, aplus
, rplus
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