Correlation between non-numeric variables
We have shown that, in the case of two numeric variables, you can get a sense of the association between them by looking at their scatterplot. Obviously, this strategy cannot be used when one or both variables are non-numeric. Note that a variable is categorical (or qualitative or nominal) when it takes on values that are names or labels, such as smartphone operating systems (iOS, Android, Linux, and so on). Let’s see how to analyze the case of two categorical variables.
The first question that comes to mind is the following: is there a graphical representation that helps us to understand whether there is a significant association between two categorical variables? The answer is yes, and it is called a mosaic plot. In short, the goal of the mosaic plot is to show, at a glance, the strength of the association between the individual elements of each variable by the color of the tiles representing the pairs of elements in question...