The video demonstrates how to conduct a correspondence analysis (CA) in R using the FactoMineR package, focusing on the package’s graphical module. The presenter loads FactoMineR, uses the built‑in ‘children’ contingency table (reasons for not having children vs. education level, plus age‑group columns), and defines active rows (first 15) and supplementary rows (last few), as well as active columns (first 5) and supplementary columns (age groups). A CA is performed, storing results in an object ‘res’. The summary.ca function is used to display eigenvalues, inertia percentages, and for each active row/column the coordinates, contributions, and squared cosines (cos2) on the first three dimensions. The presenter shows how to retrieve results for all elements or write them to a file. The core of the tutorial covers plotting the CA map with plot(res) and customizing it: hiding supplementary elements, adding a shadow to improve label readability, adjusting label size with the cx argument, and using an algorithm that minimizes label overlap. For dense label sets, transparency (unselect) and color options (e.g., gray70) are employed to differentiate selected high‑quality points (high cos2) from less informative ones, with notes on PowerPoint compatibility. The speaker demonstrates selecting elements by squared cosine thresholds, by highest contributions, and by explicit names, and shows how active and supplementary rows/columns are distinguished by color and font style. Finally, the tutorial illustrates plotting alternative dimension pairs (e.g., dimensions 1 and 3) using the axes argument, and emphasizes the utility of these graphical controls for interpreting large textual datasets where many words (rows/columns) need to be filtered for meaningful visual analysis.
Chapters
The purpose of this video is to show how to perform a correspondence analysis using the FactoMineR package, and especially how to use the graphical module of FactoMineR. At first, I will load the FactoMineR package. And I will use the dataset that is named children. So this dataset is available in the FactoMineR package. We can first visualize this dataset. So this dataset is a contingency table with, on rows, the different reasons why a couple may not wish to have children, and in columns, the level of the higher education for the couple. This dataset also has 3 columns that correspond to the age group, less than 30 years old, from 30 to 50 years old, and more than 50 years old. So we will make a correspondence analysis on this data table. The first 15 rows will correspond to the active rows, that is to say that it corresponds to rows that will be used to construct the dimensions of the principal component method of the correspondence analysis. And the last rows with very low numbers will be considered as supplementary rows. Also, we will take as active columns the first 5 columns only, and the last 3 columns corresponding to another question, the age group, will be used as supplementary information. So I will perform a correspondence analysis and put the results in an object that I called res. So the dataset is children, And I will say that the rows from 15 to 18 correspond to supplementary rows. Okay, and I say that the column from 6 to 8 corresponds to supplementary columns. So here are the results of the analysis with the map that is given by default. At first, you can have a summary of the results thanks to the function summary.ca, which can be called just using summary on the object res. With this function, we have many results. First, we have the line of code that has been used to perform the analysis. Then there is a table with the eigenvalues and the percentage of each inertia or percentage of variance associated with each dimension. So the first dimension explains 57% of variance, the second dimension 21%, and the third dimension 11%, and so on. Then we have the results for the active rows, and by default, we have the results only for the 10 first rows. So we have the coordinate of each row on the first dimension. Then we have the contribution of this row to the construction of the first dimension. The contribution is explained in percentage. And then we have a measure of the quality of representation of the row on the dimension. This indicator varies between 0 and 1. It is close to 1 if the row is well projected on the first dimension. This indicator is the squared cosine. So here are the results for the first dimension. Then we have the same for the second dimension, so coordinate, contribution, and squared cosine, and for the third dimension. So by default, we have the results of the first 3 dimensions. We, we also have the results for the columns, the same results, the coordinates, the contribution, and the square cosine for the first, the second, and the third dimension. Then we have the results for the supplementary elements, so the supplementary rows and the supplementary columns. So for the supplementary rows, we have the coordinate on the dimension and the square cosine. Of course, we do not have the contribution because the supplementary elements do not contribute to the construction of the dimension. So we may want to have the results for all the elements. So in this case, I will write nb_elements equal inf for infinity, and then I have the results for all the elements, so all the rows, all the columns, and all the supplementary rows, all the supplementary columns. You can also specify that you want to write these results in a file. So I can write the result in the file that I name myfile.txt. Now let's go back to the graphical aspects. So I will put the graphical Window like this to better see. So to perform the graph, I just have to write plotres and it draws the graph. In this map, I can specify, for instance, that I do not want the supplementary rows and the supplementary columns to appear in the— on the graph. So I will just write invisible equal rowsup And call sup. So now I have a graph with only the active elements, so the active rows and the active columns. Here you can see, for instance, that for the word egoism, this word is a little bit above the axis, and to make a graph that is nicer, I can use the argument shadow equal true. And then we can better see the label egoïsme. You see here that the labels do not overlap too much. In fact, there is an algorithm that will compute the optimal position of the labels. So optimal in the sense that it minimizes the overlapping of the labels. Now, if you have a lot of labels, the labels may overlap a bit, so I can redo the graph with all the elements, and there is more overlapping. So the first trick is to use, for example, cx= 0.8. cx= 0.8 means that the text will be smaller. cx= 1 is size by default for the labels, and serix less than 1 will write the labels in a smaller font. So you can also select some elements. For instance, I can select some rows. So here I select the rows that have a square cosine that is greater than 0.7, And I can also select the columns that have a square cosine that is greater than 0.8. So I make a selection on both the rows and columns. So the elements that have a high quality of projection, a quality of projection higher than 0.7 on the map, on this map with dimensions 1 and 2, are written. And for the other elements that have a square cosine less than 0.7, the points are written with a degree of transparency and the text is not written. So I can play on the transparency using the argument unselect. If I use unselect equals 0, I do not want any transparency and the points are written with the same color than for the elements that have a square cosine greater than 0.7. Instead, I can delete the point using unselect=1. Then I have a full transparency, and it removes the points that have a square cosine less than 0.7. So a small disadvantage if I take some transparency is that this graph cannot be copied and pasted into PowerPoint because the points disappear here. The points that are written with some transparency are not written because PowerPoint does not support transparency. So one can of course save the file using File, Save As in PDF or PostScript. It is possible, but you cannot copy and paste in PowerPoint. So what you can do is that you can use a color, for example, unselect=gray70. It is a gray color that is used for the elements that are not selected. And in this case, this graph can be copy and paste in PowerPoint, and the points are visible. And you can edit the graph and possibly move some labels if you want. I can also change my selection. So I have selected with the square cosines that are greater than 0.7. I can select only the 4 elements, the 4 rows that have the highest square cosine, and the 3 columns, for example, that have the highest square cosine. So in this case, these are the 4 rows which have the highest square cosine, and the 4 active rows that have the highest square cosine, and the 4 supplementary rows which have the highest square cosine, and the 3 columns that have the highest square cosine, and the 3 active and the 3 supplementary columns. So active rows are distinguished by a clear blue, like for circumstances. Supplementary rows are in a darker blue and in italics, like comfort. So it is the same thing for the columns. We get 3 columns that have the highest squared cosine for active columns in bright red, and for supplementary columns in dark red and in italics. So rather than using the squared cosine, we can focus on the contribution I will select the rows that have the highest contribution to construct dimensions 1 and 2, and the 3 columns that contribute the most to the construction of dimensions 1 and 2. So for the contribution, of course, I have only active elements, so the 3 active columns and the 4 active rows that contribute the most. I can also select elements using their name. So I can select the element money, the element future, because for instance I am interested by these elements. So the 2 rows that are selected are the rows money and future, and all the active and supplementary columns appear on the graph. So here is the graph and different options to build the graphs. One can of course build the graph with other dimensions, not 1 and 2, but for instance the dimensions 1 and 3. So I built the graph with dimensions 1 and 3 using the argument axes. And so dimension 1 is on the abscissa and dimension 3 on the ordinate. So in this way, it is possible to draw a graph with the dimensions you specify, and then to select the points to draw on this map. So if I use the selection with the highest contribution, I have the elements that contribute the most to the construction of dimensions 1 and 3, to the construction of this map. That's a brief presentation on how to use the graphical module of FactoMineR. This is very useful when you have many rows and/or many columns, which is often the case when dealing with textual data, when you do text mining. Indeed, in textual data, it is frequent to have a lot of words, and it is necessary to make a selection of words to interpret your graphs.