View source: R/zVarArrayError.R
zVarArrayError | R Documentation |
This function computes squared relative errors of variation arrays per group with respect to the overall variation array based on observed data in a compositional data set. Groups can be defined by either zero/unobserved data patterns or by a grouping factor in fully observed zero-free data sets.
zVarArrayError(
X,
label = 0,
groups = NULL,
breakdown = FALSE,
suppress.print = FALSE
)
X |
Compositional data set ( |
label |
Unique label ( |
groups |
Grouping factor in fully observed zero-free data sets ( |
breakdown |
Logical value. Show results broken down by group ( |
suppress.print |
Suppress printed feedback ( |
Squared relative errors (SRE) are calculated by confronting variation arrays (log-ratio variances and means) obtained per group and
the overall variation array based on observed data. Raw SREs are computed for each available pair-wise log-ratio. The weighted version uses
the corresponding group sizes to weight raw SREs. Total SRE is obtained as the sum of weighted SREs for each log-ratio. Further details by group are
provided by setting breakdown = TRUE
.
1. SRE for each log-ratio variance and mean.
2. Weighted SRE for each log-ratio variance and mean.
3. Total SRE across log-ratio variances and means.
4. Percentage contribution of each log-ratio to SRE in log-ratio variances and means.
If breakdown = TRUE
:
4. SREs per group.
5. Weighted SREs per group.
6. Percentage contribution of each group to total SRE.
zPatterns
, zVarArray
.
data(Water)
zPatterns(Water, label = 0)
zVarArrayError(Water)
zVarArrayError(Water, breakdown = TRUE)
# From a completed data set
data(mdl) # matrix of limits of detection for Water
Water_multKM <- multKM(Water,label=0,dl=mdl) # nondetects imputation
# Results split by two ficticious groups A and B
zVarArrayError(Water_multKM,groups=rep(c("A","B"),each=50))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.