CoDA_Atyp_Idx: CoDA Atypicality Index

View source: R/CoDA_Atyp_Idx.R

CoDA_Atyp_IdxR Documentation

CoDA Atypicality Index

Description

Calculates the atypicality index (ranges between 0 and 1, 1 being more atypical/different) for all the observations of a composition or compares one sample to the given composition, using Compositional Data Analysis (CoDA) principles.

Usage

CoDA_Atyp_Idx(comp, sample = NULL, thres = 0.95)

Arguments

comp

A matrix or data frame of observations for a given composition. Entries must be non-zero and positive.

sample

A one sample vector to compare against the given composition.

thres

Threshold to classify observation as atypical, from 0 to 1 (Default is 0.95)

Value

A matrix with the atypicality index or indices.

References

Aitchison, J. (1986). The statistical analysis of compositional data. Chapman and Hall.

Examples

data("Hongite", package = 'compositions')
samp = c(44, 20.4, 13.9, 9.1, 12.6)
CoDA_Atyp_Idx(Hongite)
CoDA_Atyp_Idx(Hongite, samp)


maxgav13/GMisc documentation built on June 12, 2022, 3:48 a.m.