|
1 | 1 | # Visualizing nested proportions |
2 | 2 |
|
3 | | -**Learning objectives:** |
| 3 | +## Nested proportions {-} |
4 | 4 |
|
5 | | -- THESE ARE NICE TO HAVE BUT NOT ABSOLUTELY NECESSARY |
| 5 | + |
6 | 6 |
|
7 | | -## SLIDE 1 {-} |
| 7 | +By <a href="//commons.wikimedia.org/wiki/User:BrokenSphere" title="User:BrokenSphere">BrokenSphere</a> - <span class="int-own-work" lang="en">Own work</span>, <a href="https://creativecommons.org/licenses/by-sa/3.0" title="Creative Commons Attribution-Share Alike 3.0">CC BY-SA 3.0</a>, <a href="https://commons.wikimedia.org/w/index.php?curid=3773186">Link</a> |
8 | 8 |
|
9 | | -- ADD SLIDES AS SECTIONS (`##`). |
10 | | -- TRY TO KEEP THEM RELATIVELY SLIDE-LIKE; THESE ARE NOTES, NOT THE BOOK ITSELF. |
| 9 | +Part of a whole, broken down into parts of that part, etc. |
| 10 | + |
| 11 | +For example: percent of households in the country with access to electricity, by region and by urban/rural |
| 12 | + |
| 13 | +## _Caveat visualizator_ {-} |
| 14 | + |
| 15 | +A naïve attempt to use the strategies from the previous chapter won't work: |
| 16 | + |
| 17 | +- If one sums the % of each group, it sums to more than 100%. |
| 18 | +- Because each visualized category to multiple groups (e.g., bridge era and bridge material) |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +## What may work {-} |
| 23 | + |
| 24 | +- Mosaic plots / treemaps |
| 25 | +- Nested pies |
| 26 | +- Parallel sets |
| 27 | + |
| 28 | +## Mosiac plots {-} |
| 29 | + |
| 30 | +Each area belongs to two or more groups. |
| 31 | + |
| 32 | +In the example below, each bridge is both part of a era group (crafts, emerging, mature, modern) and a material group (wood, iron, steel) |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +## Treemaps {-} |
| 37 | + |
| 38 | +Each child group belongs to one parent group. |
| 39 | + |
| 40 | +For the example below, each state belongs to one and only one region. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +## Problems of mosaic / treemaps {-} |
| 45 | + |
| 46 | +Gets visually busy very fast |
| 47 | + |
| 48 | +Hard to judge size, among other reasons, because of the different shapes of groups |
| 49 | + |
| 50 | +## Nested pie {-} |
| 51 | + |
| 52 | +How: |
| 53 | + |
| 54 | +- Make combination of groups is a slice of the pie. |
| 55 | +- Use colors and color scales to telegraph which slice belongs to which bigger group |
| 56 | + |
| 57 | +Problems: |
| 58 | + |
| 59 | +- Radial area problem |
| 60 | +- Readability declines with the number of slices |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +## Parallel sets {-} |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +## Other strategies {-} |
| 69 | + |
| 70 | +- Sunburst |
| 71 | +- Coxcomb / Nightingale |
| 72 | +- Multiple charts: overview; selective drill-down |
| 73 | +- Interactive drill-down |
| 74 | + |
| 75 | +## Sunburst {-} |
| 76 | + |
| 77 | +### Fixed length {-} |
| 78 | + |
| 79 | +Aka radial treemap (?) |
| 80 | + |
| 81 | +- Inner ring: % of group level 1 |
| 82 | +- Outer ring: % of group level 2 within level 1 |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +### Varying length {-} |
| 87 | + |
| 88 | +Length of bars: another attribute within the second level--in the case below, median salary. |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +### Nice resources {-} |
| 93 | + |
| 94 | +- [Overview](https://www.data-to-viz.com/graph/sunburst.html) |
| 95 | +- [Extended worked example](https://www.pipinghotdata.com/posts/2021-06-01-custom-interactive-sunbursts-with-ggplot-in-r/) |
| 96 | +- [R package](https://sachijay.github.io/ggsunburst/index.html) |
| 97 | + |
| 98 | +## Coxcomb / Nightingale {-} |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +Cause of death |
| 103 | + |
| 104 | +- Blue: preventable disease |
| 105 | +- Red: wounds |
| 106 | +- Black: all other causes |
| 107 | + |
| 108 | +## Multiple charts: overview; selective drill-down {-} |
| 109 | + |
| 110 | +Just imagine there was drill-down into one category |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | +## Interactive drill-down {-} |
| 115 | + |
| 116 | +See [here](https://quarto.org/docs/interactive/ojs/index.html#example). |
0 commit comments