TheseusPlot 0.2.0: Visualizing Decomposition of Differences in Rate Metrics

[This article was first published on HOXO-M Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

TheseusPlot is an R package that decomposes differences in rate metrics between two groups into contributions from individual subgroups and visualizes the results as a “Theseus Plot”.

The package is inspired by the Ship of Theseus thought experiment. It replaces subgroup data step by step, recalculates the overall metric at each step, and interprets each change as that subgroup’s contribution to the overall difference.

Suppose you notice that the click-through rate is lower in 2025 than in 2024 and want to examine how a particular attribute, such as gender, contributed to the change. If you obtain a Theseus Plot like the one below, it suggests that men contributed more to the decline in click-through rate than women.

What’s new in 0.2.0

Version 0.2.0 includes the following changes:

  • a fix for continuous-variable discretization with split = "rate", where bin boundaries for the second group could previously be computed from the first group’s data
  • a fix for the size bar of "Sum of ... other attributes", which could incorrectly use the first group’s counts for both groups
  • a fix for warnings in plot() and plot_flip() when multiple subgroups were tied for the largest absolute contribution
  • suppression of warnings generated internally by waterfalls::waterfall() during plot creation.

I would like to thank Kazuyuki Sano for reporting the first two issues and contributing to their fixes.

Installation

You can install TheseusPlot from CRAN with:

install.packages("TheseusPlot")

Try it out

TheseusPlot may be useful when you want to understand why metrics such as conversion rate, retention rate, or click-through rate changed.

For details on how to use it, please see the package website: https://hoxo-m.github.io/TheseusPlot/.

To leave a comment for the author, please follow the link and comment on their blog: HOXO-M Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)