Correspondence analysis (CA) is a multivariate statistical technique proposed by Herman Otto Hartley (Hirschfeld) and later developed by Jean-Paul Benzécri. It is conceptually similar to principal component analysis, but applies to categorical rather than continuous data. In a similar manner to principal component analysis, it provides a means of displaying or summarising a set of data in two-dimensional graphical form. Its aim is to display in a biplot any structure hidden in the multivariate setting of the data table. As such it is a technique from the field of multivariate ordination. Since the variant of CA described here can be applied either with a focus on the rows or on the columns it should in fact be called simple (symmetric) correspondence analysis.
It is traditionally applied to the contingency table of a pair of nominal variables where each cell contains either a count or a zero value. If more than two categorical variables are to be summarized, a variant called multiple correspondence analysis should be chosen instead. CA may also be applied to binary data given the presence/absence coding represents simplified count data i.e. a 1 describes a positive count and 0 stands for a count of zero. Depending on the scores used CA preserves the chi-square distance between either the rows or the columns of the table. Because CA is a descriptive technique, it can be applied to tables regardless of a significant chi-squared test. Although the statistic used in inferential statistics and the chi-square distance are computationally related they should not be confused since the latter works as a multivariate statistical distance measure in CA while the statistic is in fact a scalar not a metric.
Details
Like principal components analysis, correspondence analysis creates orthogonal components (or axes) and, for each item in a table i.e. for each row, a set of scores (sometimes called factor scores, see Factor analysis). Correspondence analysis is performed on the data table, conceived as matrix C of size m × n where m is the number of rows and n is the number of columns. In the following mathematical description of the method capital letters in italics refer to a matrix while letters in italics refer to vectors. Understanding the following computations requires knowledge of matrix algebra.
Preprocessing
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 a vector space. This origin is defined by matrix .
In fact matrix is identical with the matrix of expected frequencies in the chi-squared test. Therefore is computationally related to the independence model used in that test. But since CA is not an inferential method the term independence model is inappropriate here.