# Interpreting 2D correspondence analysis plots

I've been searching the internet far and wide... I have yet to find a really good overview of how to interpret 2D correspondence analysis plots. Could someone offer some advice on interpreting the distances between points?

Perhaps an example would help, here is a plot that's found on many of the websites I've seen that discuss correspondence analysis. The red triangles represent eye colour and the black dots represent hair colour.

Looking at the graph above, could you make a few statements about what you see in these data. Points of interest about the different dimensions and relationships between triangles and dots?

An explanation of row-points verses column points, and the use of the word "profile" with particular focus on the example would be instrumental.

-

First, there are different ways to construct so-called biplots in the case of correspondence analysis. In all cases, the basic idea is to find a way to show the best 2D approximation of the "distances" between row cells and column cells. In other words, we seek a hierarchy (we also speak of "ordination") of the relationships between rows and columns of a contingency table.

Very briefly, CA decomposes the chi-square statistic associated with the two-way table into orthogonal factors that maximize the separation between row and column scores (i.e. the frequencies computed from the table of profiles). Here, you see that there is some connection with PCA but the measure of variance (or the metric) retained in CA is the $\chi^2$, which only depends on column profiles (As it tends to give more importance to modalities that have large marginal values, we can also re-weight the initial data, but this is another story).

Here is a more detailed answer. The implementation that is proposed in the corresp() function (in MASS) follows from a view of CA as an SVD decomposition of dummy coded matrices representing the rows and columns (such that $R^tC=N$, with $N$ the total sample). This is in light with canonical correlation analysis. In contrast, the French school of data analysis considers CA as a variant of the PCA, where you seek the directions that maximize the "inertia" in the data cloud. This is done by diagonalizing the inertia matrix computed from the centered and scaled (by marginals frequencies) two-way table, and expressing row and column profiles in this new coordinate system.

If you consider a table with $i=1,\dots,I$ rows, and $j=1,\dots,J$ columns, each row is weighted by its corresponding marginal sum which yields a series of conditional frequencies associated to each row: $f_{j|i}=n_{ij}/n_{i\cdot}$. The marginal column is called the mean profile (for rows). This gives us a vector of coordinates, also called a profile (by row). For the column, we have $f_{i|j}=n_{ij}/n_{\cdot j}$. In both cases, we will consider the $I$ row profiles (associated to their weight $f_{i\cdot}$) as individuals in the column space, and the $J$ column profiles (associated to their weight $f_{\cdot j}$) as individuals in the row space. The metric used to compute the proximity between any two individuals is the $\chi^2$ distance. For instance, between two rows $i$ and $i'$, we have

$$d^2_{\chi^2}(i,i')=\sum_{j=1}^J\frac{n}{n_{\cdot j}}\left(\frac{n_{ij}}{n_{i\cdot}}-\frac{n_{i'j}}{n_{i'\cdot}} \right)^2$$

You may also see the link with the $\chi^2$ statistic by noting that it is simply the distance between observed and expected counts, where expected counts (under $H_0$, independence of the two variables) are computed as $n_{i\cdot}\times n_{\cdot j}/n$ for each cell $(i,j)$. If the two variables were to be independent, the row profiles would be all equal, and identical to the corresponding marginal profile. In other words, when there is independence, your contingency table is entirely determined by its margins.

If you realize an PCA on the row profiles (viewed as individuals), replacing the euclidean distance by the $\chi^2$ distance, then you get your CA. The first principal axis is the line that is the closest to all points, and the corresponding eigenvalue is the inertia explained by this dimension. You can do the same with the column profiles. It can be shown that there is a symmetry between the two approaches, and more specifically that the principal components (PC) for the column profiles are associated to the same eigenvalues than the PCs for the row profiles. What is shown on a biplot is the coordinates of the individuals in this new coordinate system, although the individuals are represented in a separate factorial space. Provided each individual/modality is well represented in its factorial space (you can look at the $\cos^2$ of the modality with the 1st principal axis, which is a measure of the correlation/association), you can even interpret the proximity between elements $i$ and $j$ of your contingency table (as can be done by looking at the residuals of your $\chi^2$ test of independence, e.g. chisq.test(tab)$expected-chisq.test(tab)$observed).

The total inertia of your CA (= the sum of eigenvalues) is the $\chi^2$ statistic divided by $n$ (which is Pearson's $\phi^2$).

Actually, there are several packages that may provide you with enhanced CAs compared to the function available in the MASS package: ade4, FactoMineR, anacor, and ca.

The latest is the one that was used for your particular illustration, and a paper was published in the Journal of Statistical Software that explains most of its functionnalities: Correspondence Analysis in R, with Two- and Three-dimensional Graphics: The ca Package.

So, your example on eye/hair colors can be reproduced in many ways:

data(HairEyeColor)
tab <- apply(HairEyeColor, c(1, 2), sum) # aggregate on gender
tab

library(MASS)
plot(corresp(tab, nf=2))
corresp(tab, nf=2)

library(ca)
plot(ca(tab))
summary(ca(tab, nd=2))

library(FactoMineR)
CA(tab)
CA(tab, graph=FALSE)$eig # == summary(ca(tab))$scree[,"values"]
CA(tab, graph=FALSE)$row$contrib

scatter(dudi.coa(tab, scannf=FALSE, nf=2))


In all cases, what we read in the resulting biplot is basically (I limit my interpretation to the 1st axis which explained most of the inertia):

• the first axis highlights the clear opposition between light and dark hair color, and between blue and brown eyes;
• people with blond hair tend to also have blue eyes, and people with black hair tend to have brown eyes.

There is a lot of additional resources on data analysis on the bioinformatics lab from Lyon, in France. This is mostly in French, but I think it would not be too much a problem for you. The following two handouts should be interesting as a first start:

Finally, when you consider a full disjonctive (dummy) coding of $k$ variables, you get the multiple correspondence analysis.

-
@Brandon The 1st axis is an axis of "dominance" (light -> dark) for both modalities, but we can also see that the 1st axis opposes blue and green eyes to brown and hazel eyes (their coordinates are of opposite signs), and red hair/green eye combination--which is quite uncommon--contribute mostly to the 2nd factor axis. As this axis only explains 9.5% of the total inertia, it is rather difficult to draw firm conclusions (esp. wrt. genetic hypotheses). –  chl Oct 3 '10 at 18:35
@Brandon Two further references (in english this time): the PBIL course (j.mp/cHZT7X) and Michael Friendly's resources (j.mp/cYHyVn + vcd and vcdExtra R packages, the latter including a nice vignette). –  chl Oct 3 '10 at 18:37
@Brandon Yes, one modality = one category for your variable. For your 2nd question, cor is the squared correlation with the axis, and ctr is the contribution (it has to be divided by 10 to be read as a %). So "red hair" contributes 55.1% of the inertia of the 2nd axis. In a certain sense I found the FactoMineR output more "intuitive" (CA(tab, graph=FALSE)$row$contrib gives you directly the %). –  chl Oct 3 '10 at 19:52
@chl: wow, for someone who knows nothing about CCA or the "French way", this was a great read! Many thanks. I also found this with some googling that might be of interest: www-stat.stanford.edu/~susan/papers/dfc.pdf –  ars Oct 5 '10 at 0:53
@ars (+1) Thanks for the link (didn't know about this monograph, it looks interesting). My best recommendations for recent developments are actually ALL papers from Jan de Leeuw and these two books: Multiple Correspondence Analysis And Related Methods from Greenacre, and Geometric Data Analysis: From Correspondence Analysis to Structured Data Analysis from Le Roux & Rouanet (the french way). –  chl Oct 5 '10 at 10:46