What visualization approach would you use instead of these pie charts?


Hey folks,

As I mentioned last week, I’m exploring the possibility of holding live, in person, workshops again like I did before the pandemic. If this is something that interests you, please let me know. My thought would be to hold them at an affordable hotel near the Detroit airport (DTW). But, if you would like to host me to teach a workshop, I would be open to that as well.


This week, I want to call your attention to a plot that I would not encourage you to make. This comes form “Targeted innate immune inhibition therapy compared with antibiotics for recurrent acute cystitis: a randomized, open-label phase 2 trial”, which was published recently in Nature Microbiology by Ambite and colleagues.

To be perfectly honest, whenever I see a pie chart I tell myself, “Surely there was a better way… What would have been better?” I’ll be talking more about this in the critique video next week, but how about taking some time to think about it now?

As always, we need to think about the context. The study had 20 people receive anakinra (an immunologic) and 10 receive nitrofurantoin (an antibiotic) to compare the safety and efficacy of the drugs in treating recurrent cyctitis, a type of bladder infection. Although I’m sure the developers of anakinra would have loved to see it perform better than nitrofurantoin, they also would have been happy to see the drugs perform equally. That’s because of concerns over antibiotic resistance. Does this context help you think about the design of this panel?

What is being compared? It isn’t change in symptoms back to day 1. It’s the comparison between the two drugs at each of the four time points. Those P-values are an output of testing the comparison and that all four are non-significant is one indication that anakinra is not inferior to nitrofurantoin. That test is comparing the distribution of the change in symptoms for the patients on the two drugs. It’s basically asking whether each pair of pie charts are different from each other.

I can more or less see what they want me to see with the pie charts. But I think there’s a design that would be easier for me to see the similarity. Let’s think about a couple of other designs.

First, my go to approach when pie charts are proposed is to facet the x-axis by the response variables (e.g. all symptoms gone, some symptoms gone, same symptoms or worse) and put the values next to each other that we’d like to see. In this case, I’d put time across the x-axis and the percentages on the y-axis. At each time point, I’d dodge the data by the three levels of response. Then I’d give a different color to the two drugs and plot the data as a point. Something that I gives me pause in thinking about this is that the comparison is across all the response variables, not each response individually.

Second, and I know this will shock many, what if we converted those pie charts into … stacked bar plots? Again, on the x-axis we’d put time and the y-axis the response, but we’d give each segment of the column a different color. We’d also put the stacked bar for each drug and time point next to each other. Aside from wanting to compare all three responses across the drugs together rather than individually, there’s another reason I’m open to this strategy. Namely, because there are only three responses. We could put the “all symptoms gone” on the bottom of the stack, “some symptoms gone” in the middle, and “same symptoms or worse” on top. If you wanted to compare individual responses as a secondary question, two of the three categories would have a fixed edge along the y-axis for making comparisons.

What do you think? Have I lost touch with reality?! Something that gives me a bit of pause about this approach is that we’re “hiding” the fact that there were 20 people in the anakinra group and 10 in the nitrofurantoin group. That’s why the comparison at 6 months looks different, but has a non-significant P-value. Effectively, the error bars for the nitrofurantoin are larger than they are for anakinra. This is made clear in the figure caption, but I feel like it is lost in the visual itself. Perhaps instead of putting the percentages in the tiles of the stacked bars we could put the actual number. Again, because we only have 3 categories, I think we could get away with adding those numbers without overwhelming the appearance of the figure.

Let me know what you think. Stay tuned until next week to see how they look when I give both approaches a try.

Workshops

I'm pleased to be able to offer you one of three recent workshops! With each you'll get access to 18 hours of video content, my code, and other materials. Click the buttons below to learn more

In case you missed it…

Here is a livestream that I published this week that relate to previous content from these newsletters. Enjoy!

video previewvideo preview

Finally, if you would like to support the Riffomonas project financially, please consider becoming a patron through Patreon! There are multiple tiers and fun gifts for each. By no means do I expect people to become patrons, but if you need to be asked, there you go :)

I’ll talk to you more next week!

Pat

Riffomonas Professional Development

Read more from Riffomonas Professional Development

Hey folks! Before launching into this week’s visualization, I’m looking for a bit of feedback. Since November, I’ve settled into a new routine with this newsletter and the YouTube channel. Each week this newsletter introduces a visualization at a 30,000 ft view or discusses a specific topic in some depth (example). The following Monday I post a video critiquing the visualization (example). Then on Wednesday (or Tuesday like this past week), I livestream a video where I recreate the...

Hey folks! I just got back from a seminar. I’m still trying to stretch out my eyes from straining to see the small text on each slide! If you don’t know why I’m brining this up, then you must have missed the videos I posted earlier this week. I was discussing the factors we should consider when converting figures designed for papers to figures designed to a slide deck. You can see me critique a figure from my own lab here and the livestream where I refactor the figure can be found here. I’d...

Hey folks, I was a student-invited speaker at the Syracuse University Biology department this week. It was great to meet with them and hear how they are benefiting from these newsletters and my videos. As much as I love posting newsletters and videos, seeing people light up at ideas, laugh at my jokes, and tell me how they are using what I teach them is like jet fuel. I actually gave two talks. One talk covered what I’ve learned about data visualization by critiquing, recreating, and remaking...