What is an appropriate graph to illustrate the relationship between two ordinal variables?
A few options I can think of:
- Scatter plot with added random jitter to stop points hiding each other. Apparently a standard graphic - Minitab calls this an "individual values plot". In my opinion it may be misleading as it visually encourages a kind of linear interpolation between ordinal levels, as if the data were from an interval scale.
- Scatter plot adapted so that size (area) of point represents frequency of that combination of levels, rather than drawing one point for each sampling unit. I have occasionally seen such plots in practice. They can be hard to read, but the points lie on a regularly-spaced lattice which somewhat overcomes the criticism of the jittered scatter plot that it visually "intervalises" the data.
- Particularly if one of the variables is treated as dependent, a box plot grouped by the levels of the independent variable. Likely to look terrible if the number of levels of the dependent variable is not sufficiently high (very "flat" with missing whiskers or even worse collapsed quartiles which makes visual identification of median impossible), but at least draws attention to median and quartiles which are relevant descriptive statistics for an ordinal variable.
- Table of values or blank grid of cells with heat map to indicate frequency. Visually different but conceptually similar to the scatter plot with point area showing frequency.
Are there other ideas, or thoughts on which plots are preferable? Are there any fields of research in which certain ordinal-vs-ordinal plots are regarded as standard? (I seem to recall frequency heatmap being widespread in genomics but suspect that is more often for nominal-vs-nominal.) Suggestions for a good standard reference would also be very welcome, I am guessing something from Agresti.
If anyone wants to illustrate with a plot, R code for bogus sample data follows.
"How important is exercise to you?" 1 = not at all important, 2 = somewhat unimportant, 3 = neither important nor unimportant, 4 = somewhat important, 5 = very important.
"How regularly do you take a run of 10 minutes or longer?" 1 = never, 2 = less than once per fortnight, 3 = once every one or two weeks, 4 = two or three times per week, 5 = four or more times per week.
If it would be natural to treat "often" as a dependent variable and "importance" as an independent variable, if a plot distinguishes between the two.
importance <- rep(1:5, times = c(30, 42, 75, 93, 60)) often <- c(rep(1:5, times = c(15, 07, 04, 03, 01)), #n=30, importance 1 rep(1:5, times = c(10, 14, 12, 03, 03)), #n=42, importance 2 rep(1:5, times = c(12, 23, 20, 13, 07)), #n=75, importance 3 rep(1:5, times = c(16, 14, 20, 30, 13)), #n=93, importance 4 rep(1:5, times = c(12, 06, 11, 17, 14))) #n=60, importance 5 running.df <- data.frame(importance, often) cor.test(often, importance, method = "kendall") #positive concordance plot(running.df) #currently useless
A related question for continuous variables I found helpful, maybe a useful starting point: What are alternatives to scatterplots when studying the relationship between two numeric variables?