# bada: Barycentric Discriminant Analysis In bbuchsbaum/neuropls: neuroca: multiblock component analysis for neuroimaging data

## Description

A component technique that maximizes the between group variance over a set of variables.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10``` ```bada( Y, X, S = rep(1, nrow(X)), ncomp = length(levels(as.factor(Y))) - 1, preproc = center(), A = NULL, M = NULL, ... ) ```

## Arguments

 `Y` dependent `factor` variable. The categories of the observations. `X` the data matrix with `nrow` equal to `length` of `Y` `S` an integer `vector` or `factor` of subject ids which is the same length as `Y`. `ncomp` number of components to estimate `preproc` pre-processing function, defaults to `center` `A` the column constraints `M` the row constraints `...` arguments to pass through

## Details

The `S` argument can be used to model multi-level structure. If `S` is included, then pre-processing is applied separately to each unique value of S. This has the effect, for example when preproc = `center` of removing subject-specific means before computing the barycetners.

## References

Abdi, H., Williams, L. J., & Bera, M. (2017). Barycentric discriminant analysis. Encyclopedia of Social Network Analysis and Mining, 1-20.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24``` ```X <- matrix(rnorm(100*1000), 100, 1000) Y <- factor(rep(letters[1:4], length.out=100)) S <- factor(rep(1:10, each=10)) bres <- bada(Y, X, S, ncomp=3) project(bres, X[S==1,]) ## no strata bres <- bada(Y, X, ncomp=3) xbar <- matrix(rnorm(4*1000), 4, 1000) Y <- factor(rep(letters[1:4], length.out=100)) X <- do.call(rbind, lapply(as.character(Y), function(y) { switch(y, "a" = xbar[1,] + rnorm(1000)*5, "b" = xbar[2,] + rnorm(1000)*5, "c" = xbar[3,] + rnorm(1000)*5, "d" = xbar[4,] + rnorm(1000)*5) } )) bres2 <- bada(Y, X, S, ncomp=3) ```

bbuchsbaum/neuropls documentation built on Dec. 9, 2020, 7:02 p.m.