partialProj4CA: Compute blocks (of columns or rows) partial projections for a...

View source: R/BlockProjections.R

partialProj4CAR Documentation

Compute blocks (of columns or rows) partial projections for a Correspondence Analysis.

Description

partialProj4CA computes blocks (of columns or rows) partial projections for a Correspondence Analysis (CA). Blocks are non-overlapping sets of of columns or rows of a data table analyzed with CA (as performed with epCA from ExPosition). partialProj4CA gives the partial projection for the blocks. These projections are barycentric because the barycenters of the partial projections are equal to the factor scores for the whole table.

Usage

partialProj4CA(resCA, code4Blocks, rowBlocks = FALSE)

Arguments

resCA

the results of the (CA) analysis from epCA, for example reFromCA <- epCA(X).

code4Blocks

a vector indicating which columns (or rows) belong to what block (i.e., the of columns or rows of the same block have the same level for code4Block): Needs to be of length equal to the number of variables (resp. rows) of the analysis.

rowBlocks

= FALSE (default). When TRUE, partialProj4CA runs the analysis on blocks of rows instead of blocks of columns and exchange the roles of the of columns and rows.

Details

In CA, the (barycentric) partial projections are obtained by rewriting the CA "reconstitution" formula (see Escofier, 1980; Abdi & Béra, 2018).

Value

a list with (1) Fk: an I*L*K array of the partial projections for the L factors (from epCA) of the K blocks, for the I rows (if rowBlock is FALSE for the J columns if rowBlock is TRUE); (2) Ctrk an I*L (resp. J*L) matrix of the "relative" block contributions [for a given component the relative contributions sum to 1]; (3) absCtrk an I*L (resp I*L) matrix of the "absolute" block contributions [for a given component the absolute contributions sum to the eigenvalue for this component]; (4) bk a K*1 vector storing the weights for the blocks, (5) resRV a list with (a) a matrix storing the RV coefficients between the blocks and, if the package FactoMineR is installed, (b) the p-value for the RV-coefficient (as computed with FactoMineR::coeffRV).

Author(s)

Hervé Abdi

References

Escofier, B. (1980). Analyse factorielle de très grands tableaux par division en sous-tableaux. In Diday et al.: Data Analysis and Informatics. Amsterdam: North-Holland. pp 277-284.

Abdi H., & Béra, M. (2018). Correspondence analysis. In R. Alhajj and J. Rokne (Eds.), Encyclopedia of Social Networks and Mining (2nd Edition). New York: Springer Verlag.

Examples

## Not run: 
# Get the data/CA function from Exposition
 library(ExPosition)
 data(authors, package = 'ExPosition')
 X <- (authors$ca$data) # the data
 zeBlocks <- as.factor(c(1,1,2,2,3,3)) # 3 blocks
 resCA <- epCA(X, graphs = FALSE) # CA of X
 resPart <- partialProj4CA(resCA, zeBlocks, rowBlocks = TRUE)
 # partial factor scores are in \code{resPart}

## End(Not run)

HerveAbdi/PTCA4CATA documentation built on July 17, 2022, 5:41 a.m.