Details
LikePreprocessing
Before proceeding to the central computational step of the algorithm, the values in matrix ''C'' have to be transformed. First compute a set of weights for the columns and the rows (sometimes called ''masses''), where row and column weights are given by the row and column vectors, respectively: : Here is the sum of all cell values in matrix ''C'', or short the sum of ''C'', and is a column vector of ones with the appropriate dimension. Put in simple words, is just a vector whose elements are the row sums of ''C'' divided by the sum of ''C'', and is a vector whose elements are the column sums of ''C'' divided by the sum of ''C''. The weights are transformed into diagonal matrices : and : where the diagonal elements of are and those of are respectively i.e. the vector elements are the inverses of the square roots of the masses. The off-diagonal elements are all 0. Next, compute matrix by dividing by its sum : In simple words, Matrix is just the data matrix (contingency table or binary table) transformed into portions i.e. each cell value is just the cell portion of the sum of the whole table. Finally, compute matrix '''', sometimes called the matrix of ''standardized residuals'', by matrix multiplication as : Note, the vectors and are combined in an outer product resulting in a matrix of the same dimensions as . In words the formula reads: matrix is subtracted from matrix '''' and the resulting matrix is scaled (weighted) by the diagonal matrices and . Multiplying the resulting matrix by the diagonal matrices is equivalent to multiply the i-th row (or column) of it by the i-th element of the diagonal of or , respectively''.''Interpretation of preprocessing
The vectors and are the row and column masses or the marginal probabilities for the rows and columns, respectively. Subtracting matrix from matrix '''' is the matrix algebra version of double centering the data. Multiplying this difference by the diagonal weighting matrices results in a matrix containing weighted deviations from the origin of aOrthogonal components
The table '''' is then decomposed by aInertia
While a principal component analysis may be said to decompose the (co)variance, and hence its measure of success is the amount of (co-)variance covered by the first few PCA axes - measured in eigenvalue -, a CA works with a weighted (co-)variance which is called ''inertia''. The sum of the squared singular values is the ''total inertia'' of the data table, computed as : The ''total inertia'' of the data table can also computed directly from '''' as : The amount of inertia covered by the i-th set of singular vectors is , the ''principal inertia.'' The higher the portion of inertia covered by the first few singular vectors i.e. the larger the sum of the principal inertiae in comparison to the total inertia, the more successful a CA is. Therefore, all principal inertia values are expressed as portion of the total inertia : and are presented in the form of a scree plot. In fact a scree plot is just a bar plot of all principal inertia portions .Coordinates
To transform the singular vectors to coordinates which preserve the chisquare distances between rows or columns an additional weighting step is necessary. The resulting coordinates are called ''principal coordinates'' in CA text books. If principal coordinates are used for rows their visualization is called a ''row isometric'' scaling in econometrics and ''scaling 1'' in ecology. Since the weighting includes the singular values of the matrix of standardized residuals these coordinates are sometimes referred to as ''singular value scaled singular vectors'', or, a little bit misleading, as eigenvalue scaled eigenvectors. In fact the non-trivial eigenvectors of are the left singular vectors of and those of are the right singular vectors of while the eigenvalues of either of these matrices are the squares of the singular values . But since all modern algorithms for CA are based on a singular value decomposition this terminology should be avoided. In the French tradition of CA the coordinates are sometimes called (factor) ''scores''. Factor scores or ''principal coordinates'' for the rows of matrix ''C'' are computed by : i.e. the left singular vectors are scaled by the inverse of the square roots of the row masses and by the singular values. Because principal coordinates are computed using singular values they contain the information about the spread between the rows (or columns) in the original table. Computing the euclidean distances between the entities in principal coordinates results in values that equal their chisquare distances which is the reason why CA is said to ''"preserve chisquare distances"''. Compute principal coordinates for the columns by : To represent the result of CA in a proper biplot, those categories which are ''not'' plotted in principal coordinates, i.e. in chisquare distance preserving coordinates, should be plotted in so called ''standard coordinates''. They are called standard coordinates because each vector of standard coordinates has been standardized to exhibit mean 0 and variance 1. When computing standard coordinates the singular values are omitted which is a direct result of applying the biplot rule by which one of the two sets of singular vector matrices must be scaled by singular values raised to the power of zero i.e. multiplied by one i.e. be computed by omitting the singular values if the other set of singular vectors have been scaled by the singular values. This reassures the existence of aGraphical representation of result
The visualization of a CA result always starts with displaying the scree plot of the principal inertia values to evaluate the success of summarizing spread by the first few singular vectors. The actual ordination is presented in a graph which could - at first look - be confused with a complicated scatter plot. In fact it consists of two scatter plots printed one upon the other, one set of points for the rows and one for the columns. But being a biplot a clear interpretation rule relates the two coordinate matrices used. Usually the first two dimensions of the CA solution are plotted because they encompass the maximum of information about the data table that can be displayed in 2D although other combinations of dimensions may be investigated by a biplot. A biplot is in fact a low dimensional mapping of a part of the information contained in the original table. As a rule of thumb that set (rows or columns) which should be analysed with respect to its composition as measured by the other set is displayed in principal coordinates while the other set is displayed in standard coordinates. E.g. a table displaying voting districts in rows and political parties in columns with the cells containing the counted votes may be displayed with the districts (rows) in principal coordinates when the focus is on ordering districts according to similar voting. Traditionally, originating from the French tradition in CA, early CA biplots mapped both entities in the same coordinate version, usually principal coordinates, but this kind of display is misleading insofar as: "Although this is called a biplot, it does ''not'' have any useful inner product relationship between the row and column scores" as Brian Ripley, maintainer of R package MASS points out correctly. Today that kind of display should be avoided since laymen usually are not aware of the lacking relation between the two point sets. A ''scaling 1'' biplot (rows in principal coordinates, columns in standard coordinates) is interpreted as follows: * The distances between row points approximate their chi-square distance. Points close to each other represent rows with very similar values in the original data table. I.e they may exhibit rather similar frequencies in case of count data or closely related binary values in case of presence/absence data. * (Column) points in standard coordinates represent the vertices of the vector space i.e. the outer corner of something that in multidimensional space has the shape of an irregular polyhedron. Project row points onto the line connecting the origin and the standard coordinate of a column; if the projected position along that connection line is close to the position of the standard coordinate, that row point is strongly associated with this column i.e. in case of count data the row has a high frequency of that category and in case of presence/absence data the row is likely to exhibit a 1 in that column. Row points whose projection would require to elongate the connection line beyond the origin have a lower than average value in that column.Extensions and applications
Several variants of CA are available, including detrended correspondence analysis (DCA) and canonical correspondence analysis (CCA). The latter (CCA) is used when there is information about possible causes for the similarities between the investigated entities. The extension of correspondence analysis to many categorical variables is called multiple correspondence analysis. An adaptation of correspondence analysis to the problem of discrimination based upon qualitative variables (i.e., the equivalent of discriminant analysis for qualitative data) is called discriminant correspondence analysis or barycentric discriminant analysis. In the social sciences, correspondence analysis, and particularly its extension multiple correspondence analysis, was made known outside France through French sociologistImplementations
* The data visualization system Orange include the module: orngCA. * The statistical programming language R includes several packages, which offer a function for (simple symmetric) correspondence analysis. Using the R notation ackage_name::function_namethe packages and respective functions are:ade4::dudi.coa()
, ca::ca()
, ExPosition::epCA()
, FactoMineR::CA()
, MASS::corresp()
, vegan::cca()
. The easiest approach for beginners is ca::ca()
as there is an extensive text book accompanying that package.
*The Freeware PAST (PAleontological STatistics) offers (simple symmetric) correspondence analysis via the menu "Multivariate/Ordination/Correspondence (CA)".
See also
* Formal concept analysisReferences
{{Authority control Dimension reduction