Robust Estimation for Compositional Data

Methods for analysis of compositional data including robust methods, imputation, methods to replace rounded zeros, (robust) outlier detection for compositional data, (robust) principal component analysis for compositional data, (robust) factor analysis for compositional data, (robust) discriminant analysis for compositional data (Fisher rule), robust regression with compositional predictors and (robust) Anderson-Darling normality tests for compositional data as well as popular log-ratio transformations (addLR, cenLR, isomLR, and their inverse transformations). In addition, visualisation and diagnostic tools are implemented as well as high and low-level plot functions for the ternary diagram.


Robust Methods for Compositional Data

using robCompositions

data(expenditures)

p1 <- pcaCoDa(expenditures)

plot(p1)

  • Imputation of compositional data including robust methods, methods to impute rounded zeros
  • Outlier detection for compositional data using robust methods
  • Principal component analysis for compositional data using robust methods
  • Factor analysis for compositional data using robust methods
  • Discriminant analysis for compositional data (Fisher rule) using robust methods
  • Robust regression with compositional predictors
  • Anderson-Darling normality tests for compositional data
  • log-ratio transformations (addLR, cenLR, isomLR, and their inverse transformations).
  • In addition, visualisation and diagnostic tools are implemented as well as high and low-level plot functions for the ternary diagram.
  • never use classical statistical methods on raw compositional data again.

The package has dependencies on

R (>= 2.10), utils, robustbase, rrcov, car (>= 2.0-0), MASS, pls

Installion of robCompositions is really easy for registered users (when the R-tools are installed). Just use

library(devtools)
install_github("robCompositions", "matthias-da")

data(expenditures)

expenditures[1,3]

expenditures[1,3] <- NA

impKNNa(expenditures)$xImp[1,3]

data(expenditures)

x <- expenditures

x[1,3]

x[1,3] <- NA

xi <- impCoda(x)$xImp

xi[1,3]

s1 <- sum(x[1,-3])

impS <- sum(xi[1,-3])

xi[,3] * s1/impS

xi <- impKNNa(expenditures)

xi

summary(xi)

plot(xi, which=1)

plot(xi, which=2)

plot(xi, which=3)

data(expenditures)

p1 <- pcaCoDa(expenditures)

p1

plot(p1)

data(expenditures)

oD <- outCoDa(expenditures)

oD

plot(oD)

data(arcticLake)

x <- arcticLake

x.alr <- addLR(x, 2)

y <- addLRinv(x.alr)

addLRinv(addLR(x, 3))

data(expenditures)

x <- expenditures

y <- addLRinv(addLR(x, 5))

head(x)

head(y)

addLRinv(x.alr, ivar=2, useClassInfo=FALSE)

data(expenditures)

eclr <- cenLR(expenditures)

inveclr <- cenLRinv(eclr)

head(expenditures)

head(inveclr)

head(cenLRinv(eclr$x.clr))

require(MASS)

Sigma <- matrix(c(5.05,4.95,4.95,5.05), ncol=2, byrow=TRUE)

z <- isomLRinv(mvrnorm(100, mu=c(0,2), Sigma=Sigma))

News

Changes in robCompositions version 2.0.2

  • new function balZav()
  • new function daCoDa()
  • new function clustCoDa()
  • new function corCoDa()
  • aDist for single matrix
  • pcaCoDa() with external variables
  • new data set alcoholreg
  • new data set alcohol
  • new data set economy
  • new data set ageCatWorld
  • new data set election
  • new data set laborForce
  • new data set payments

Changes in robCompositions version 2.0.1

  • discriminant analysis (daFisher) for n-group case
  • discriminant analysis (daFisher) including predict
  • discriminant analysis (daFisher) including misclassification rates

Changes in robCompositions version 2.0.0

  • combined help for some S3methods
  • function robVariation is now called variation
  • new data sets

Changes in robCompositions version 1.9.1

  • now with roxygen2 documentation
  • minor modifications in impRZilr

Changes in robCompositions version 1.9.0

  • bug in robVariations solved

Changes in robCompositions version 1.8.0

  • critical bug in function impRZilr solved (did worked only correct for constant sum data)

Changes in robCompositions version 1.7.0

  • bug in function impRZilr solved
  • new bootstrap procedure for estimating the number of components within impRZilr
  • description in function impRZilr adapted

Changes in robCompositions version 1.6.4

  • deprecated functions alr, ilr, clr, invalr, invilr, invclr deleted
  • bugfix and enhancement of impRZilr.R
  • improvement of isomLR for high-dimensional data

Changes in robCompositions version 1.6.3

+ function impAll included.
+ robGUI excluded (is now put in the compositionsGUI package)

Changes in robCompositions version 1.6.2

+ alr, clr, ilr, invalr, invclr, invilr are now deprecated. The new functions are called
  addLR, cenLR, isomLR, addLRinv, cenLRinv, isomLRinv
+ new functions gm, orthbasis, missPatterns and zeroPatterns
+ return instead of invisible return for all log-ratio transformations

Changes in robCompositions version 1.5.0

+ variable names in expendiure data corrected
+ graphical user interface added    
+ vignette about an overview of the package added
+ alrEM() function now renamed in impRZalr() to be consistent with notation

Changes in robCompositions version 1.4.6

+ correct transformation of the detection limit in impRZilr when having not constant sum 1.

Changes in robCompositions version 1.4.5

+ Bug in alrEM fixed.

+ impRZilr included, but without documentation.

Changes in robCompositions version 1.4.4

+ Description for the Expenditures data changed. Wrong variable description fixed.

+ Wrong formula in robVariation method robust=FALSE fixed after an comment 
  from from Mark Engle (thanks!).

+ Improved code in 'CITATION' file.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("robCompositions")

2.0.3 by Matthias Templ, 4 months ago


Browse source code at https://github.com/cran/robCompositions


Authors: Matthias Templ, Karel Hron, Peter Filzmoser


Documentation:   PDF Manual  


Task views: Official Statistics & Survey Methodology


GPL-2 license


Imports car, e1071, rrcov, cluster, cvTools, fpc, GGally, kernlab, MASS, mclust, Rcpp, sROC, VIM

Depends on robustbase, ggplot2, data.table, pls

Suggests knitr

Linking to Rcpp


Imported by mvoutlier.

Suggested by simFrame.


See at CRAN