Recently I stumbled across a line graph displaying a contingency table which I found was a very powerfull visualization. In my opinion it is very seldom that nominal data is displayed this way; usually plots like a bar plot, mosaic plot etc. are used (see here or here for example).
To illustrate I provide a) a bar plot, b) a mosaic plot and c) a line plot for the same data. The Titanic data shows the frequencies for the variables Survived (yes vs. no), Sex (males vs. females) and class (1st, 2nd, 3rd and crew). I only included adults in the plots.
a) Bar plot
b) Mosaic plot
c) Line plot
The line graph seems to clearly display what is going on, e.g. more males than females in total, class has a big effect on survival and so does sex, etc. Drawbacks of the line graph I can think of:
- The line goes through area were no category exists, e.g. there is nothing between first and second class. But: this seems to highlight what the changes between the categories are. It`s kind of like a piecewise regression which shows the slope between two adjacent categories.
- It is confusing if we would include confidence intervalls here because the ci must not follow the line. But: Mosaic plots can not display ci either.
What are other drawbacks of the line graph here? Considering the rare use of the line graph in this case I guess there must be more. Or am I wrong and line graphs are a legitim/ common way to display nominal data?