More effective data visualisation

Visualisation for data exploration

Dr Nicola Rennie

Introduction

Lecturer in Health Data Science within the Centre for Health Informatics, Computing, and Statistics.


Background in statistics, operational research, and data science consultancy.


Co-author of Royal Statistical Society’s Best Practices for Data Visualisation guidance.

CHICAS logo

Outline

This session will include:

  • Understand why data visualisation is necessary, and what it can be used for.

  • Explore common types of visualisation and how they can be leveraged to uncover relationships in data.

  • Be able to adjust default settings of charts to get a more truthful representation of your data.

Why visualise data?

Why visualise data?

Data visualisation has two main purposes:

  • Exploratory data analysis and identifying data issues
  • Communicating insights and results

Examples of sequential, diverging, and qualitative palettes

Exploratory data visualisation

Because summary statistics aren’t enough…

Dataset A B
mean_x 54.2632732 54.2658818
mean_y 47.8322528 47.8314957
sd_x 16.7651420 16.7688527
sd_y 26.9354035 26.9386081
cor_xy -0.0644719 -0.0686092

Identifying issues with data

Understanding missing data

Exploring patterns in data

John Snow collected data on cholera deaths and created a visualisation where the number of deaths was represented by the height of a bar at the corresponding address in London.

This visualisation showed that the deaths clustered around Broad Street, which helped identify the cause of the cholera transmission, the Broad Street water pump.

Snow. 1854.

John Snow cholera map

Choosing a visualisation type

A note about terminology

It's a Bird, It's a Plane cartoon

A note about terminology

Is it a plot? Is it a chart? Is it a graph? Or is it an infographic?

  • Plot: Raw data e.g. scatter plot.
  • Chart: Plot plus assumptions or interpretation e.g. scatter plot with line of best fit.
  • Graph: Mathematical representation of a network.
  • Infographic: Complex or combinations of chart that take longer to understand.

What are you trying to understand?

Data visualisations must serve a purpose.

Ask yourself:

  • What is the purpose?
  • Does the visualisation support the purpose?
  • Is it quick, accurate, and intuitive?

A frequent aim: comparison.

Choosing a chart type

What is the purpose of the chart?

Try: ft-interactive.github.io/visual-vocabulary

Screenshot of visual vocabulary website

Comparing distributions for different groups

Comparisons with small multiples

What are you comparing?

Box plots are just summary statistics in disguise…

Box plots hide information.

Layouts, aspect ratios, and axes

Should the axes start at 0?

Layouts, aspect ratios, and axes

They don’t always have to start at zero…

Axis ranges

Comparing categories

Use common sense!

Badly ordered chart of covid cases

Source: Georgia Department of Public Health

Order based on magnitude unless the category order has meaning…

Colours

Why use colours in data visualisation?

  • Colours should serve a purpose, e.g. discerning groups of data

  • Colours can highlight or emphasise parts of your data.

  • Not always the most effective for, e.g. communicating differences between variables.

Colour palette types

Different types of colour palettes…


… for different types of data.

Examples of sequential, diverging, and qualitative palettes

Choosing colours

Is this a good choice of colour?

Accessible colours

Check for colourblind friendly plots with colorblindr::cvd_grid(g).

Where do you find colours?

  • In base R via {RColorBrewer}: brewer.pal(4, "Dark2")

  • In {ggplot2}, scale_fill_brewer(), scale_fill_distiller(), scale_colour_brewer(), scale_colour_distiller().

  • In Python via ColorBrewer

Discussion

In groups, discuss how you might visualise the following data?

study_id treatment dosing_regimen_for_scurvy gum_rot_d6 skin_sores_d6 weakness_of_the_knees_d6 lassitude_d6 fit_for_duty_d6
001 cider 1 quart per day 2_moderate 2_moderate 2_moderate 2_moderate 0_no
002 cider 1 quart per day 2_moderate 1_mild 2_moderate 3_severe 0_no
003 dilute_sulfuric_acid 25 drops of elixir of vitriol, three times a day 1_mild 3_severe 3_severe 3_severe 0_no
004 dilute_sulfuric_acid 25 drops of elixir of vitriol, three times a day 2_moderate 3_severe 3_severe 3_severe 0_no
005 vinegar two spoonfuls, three times daily 3_severe 3_severe 3_severe 3_severe 0_no
006 vinegar two spoonfuls, three times daily 3_severe 3_severe 3_severe 3_severe 0_no
007 sea_water half pint daily 3_severe 3_severe 3_severe 3_severe 0_no
008 sea_water half pint daily 3_severe 3_severe 3_severe 3_severe 0_no
009 citrus two lemons and an orange daily 1_mild 1_mild 0_none 1_mild 0_no
010 citrus two lemons and an orange daily 0_none 0_none 0_none 0_none 1_yes
011 purgative_mixture a nutmeg-sized paste of garlic, mustard seed, horseradish, balsam of Peru, and gum myrrh three times a day 3_severe 3_severe 3_severe 3_severe 0_no
012 purgative_mixture a nutmeg-sized paste of garlic, mustard seed, horseradish, balsam of Peru, and gum myrrh three times a day 3_severe 3_severe 3_severe 3_severe 0_no

A Treatise on the Scurvy in Three Parts. James Lind. 1757.

03:00

Initial exploration of data

Example data

Smart Pill Data: causeweb.org/tshs/smart-pill

Group Gender Race Height Weight Age GE Time SB Time C Time WG Time S Contractions S Sum of Amplitudes S Mean Peak Amplitude S Mean pH SB Contractions SB Sum of Amplitudes SB Mean Peak Amplitude SB Mean pH Colon Contractions Colon Sum of Amplitudes C Mean Peak Amplitude C Mean pH
0 1 NA 182.880 102.05820 25 74.30 8.40 NA 816.00 NA NA NA NA NA NA NA NA NA NA NA NA
0 1 NA 180.340 102.05820 39 73.30 13.80 NA 168.00 NA NA NA NA NA NA NA NA NA NA NA NA
0 1 NA 180.340 68.03880 44 4.30 6.70 NA 240.00 NA NA NA NA NA NA NA NA NA NA NA NA
0 1 NA 175.260 69.85317 53 NA NA NA 216.00 NA NA NA NA NA NA NA NA NA NA NA NA
0 0 NA 152.400 44.90561 57 13.90 5.10 NA 120.00 NA NA NA NA NA NA NA NA NA NA NA NA
0 1 NA 185.420 94.80073 43 23.30 8.70 NA 384.00 NA NA NA NA NA NA NA NA NA NA NA NA
0 1 NA 187.960 86.18248 38 7.50 3.70 NA 240.00 NA NA NA NA NA NA NA NA NA NA NA NA
0 0 NA 165.100 76.20346 23 5.60 3.40 NA 288.00 NA NA NA NA NA NA NA NA NA NA NA NA
1 1 1 172.720 74.38909 21 2.73 5.12 43.28 51.13 145 2254.16 15.545931 2.07 298 5382.65 18.06258 7.26 507 19073.39 37.62010 7.58
1 0 1 170.180 64.86366 24 5.02 3.30 14.03 22.35 114 3747.70 32.874561 2.28 782 14044.54 17.95977 7.21 50 1872.63 37.45260 7.21
1 1 3 180.340 58.96696 24 1.97 4.46 44.82 51.25 47 1243.40 26.455319 3.63 514 8057.50 15.67607 7.04 615 23738.55 38.59927 6.96
1 0 1 160.020 72.57472 28 2.90 4.17 16.48 23.55 115 2362.17 20.540609 3.35 686 10557.72 15.39026 7.08 289 10804.28 37.38505 7.07
1 1 1 180.340 81.64656 23 2.54 3.15 24.25 29.94 92 1934.87 21.031196 3.72 323 5457.92 16.89759 7.35 344 14388.44 41.82686 7.51
1 0 1 161.290 58.96696 32 3.47 4.55 23.08 31.10 99 2878.43 29.075050 3.80 1017 21231.00 20.87611 7.42 870 34252.14 39.37028 7.48
1 1 3 180.340 69.39958 22 2.30 3.72 4.83 10.85 312 6541.72 20.967051 4.88 937 18096.22 19.31293 8.55 190 6411.08 33.74253 7.67
1 1 3 175.260 77.11064 22 2.68 NA NA 11.40 NA NA NA NA NA NA NA NA NA NA NA NA
1 1 1 175.260 77.11064 56 2.95 4.25 11.70 18.90 80 1908.23 23.852875 2.93 856 17960.18 20.98152 7.02 245 11178.98 45.62849 7.24
1 1 2 182.880 87.54326 38 4.45 5.33 15.72 25.50 179 3521.92 19.675531 2.35 1467 27197.41 18.53948 7.26 276 12109.95 43.87663 5.88
1 0 1 167.640 77.11064 37 2.47 3.82 92.61 98.90 756 13216.65 17.482341 2.39 1270 24570.12 19.34655 6.33 1019 43797.60 42.98096 6.81
1 1 4 172.720 77.11064 40 2.96 3.47 1.68 8.11 72 1155.44 16.047778 3.30 332 6033.49 18.17316 6.93 82 3185.28 38.84488 6.95
1 0 2 154.940 79.37860 50 5.68 13.45 13.20 32.33 531 11498.41 21.654256 2.57 NA NA NA NA NA NA NA NA
1 1 2 180.340 83.91452 38 2.51 5.03 58.04 65.58 144 655.57 4.552569 2.33 686 12678.62 18.48195 6.95 2134 108317.43 50.75793 7.21
1 0 2 175.260 69.85317 18 3.64 5.96 118.87 128.47 195 3443.05 17.656667 2.27 1926 34892.11 18.11636 7.44 1585 63621.70 40.13987 7.16
1 0 1 160.020 61.68851 19 3.63 3.37 19.40 26.40 138 2757.41 19.981232 3.68 416 7639.09 18.36320 6.87 737 28518.43 38.69529 7.91
1 1 1 182.880 74.84268 28 3.93 2.52 21.70 28.15 122 2285.98 18.737541 1.96 225 3899.38 17.33058 6.83 298 9780.58 32.82074 6.53
1 1 3 175.260 77.56423 31 2.82 4.87 13.35 21.04 279 4200.98 15.057276 3.26 986 14773.17 14.98293 6.98 292 13341.08 45.68863 7.23
1 0 4 162.560 59.87414 38 3.45 2.87 27.56 33.88 274 4844.47 17.680547 3.14 930 21308.33 22.91218 7.23 662 31176.60 47.09456 8.10
1 1 1 170.180 87.54326 50 2.30 2.25 16.29 20.84 215 4022.44 18.709023 4.43 967 26734.08 27.64641 7.11 1021 50266.53 49.23264 7.43
1 1 2 175.260 86.18248 44 2.72 3.71 1.19 7.62 142 3912.15 27.550352 4.82 338 6462.99 19.12127 6.50 97 3620.37 37.32340 6.44
1 1 4 162.560 60.78133 57 3.95 2.80 22.03 28.78 NA NA NA NA NA NA NA NA NA NA NA NA
1 1 2 162.560 74.84268 41 2.13 2.92 17.83 22.88 113 2756.66 24.395221 4.28 759 13068.14 17.21758 7.04 773 43683.05 56.51106 7.22
1 0 1 167.640 72.57472 50 2.70 3.47 19.75 25.92 134 2261.28 16.875224 3.18 324 5390.28 16.63667 7.10 836 34536.38 41.31146 6.82
1 0 1 175.260 79.37860 37 3.32 2.75 7.43 13.50 138 2682.13 19.435725 2.89 488 9454.08 19.37311 7.30 295 12672.70 42.95831 6.75
1 1 1 162.560 70.76035 37 3.04 4.46 43.54 51.04 241 5180.03 21.493900 3.65 556 9875.23 17.76121 7.00 1112 46344.61 41.67681 7.36
1 1 1 177.800 68.03880 23 4.70 3.75 17.75 26.20 175 3797.16 21.698057 1.82 242 4685.40 19.36116 6.01 364 16101.20 44.23407 7.33
1 1 1 177.800 97.52228 40 3.58 2.50 4.35 10.43 110 2648.17 24.074273 3.60 243 5229.87 21.52210 6.22 189 7471.15 39.52989 7.50
1 0 1 177.800 72.57472 34 2.92 NA NA 5.99 305 6681.77 21.907443 2.39 NA NA NA NA NA NA NA NA
1 0 1 172.720 74.84268 64 2.17 4.21 17.49 23.87 227 5522.37 24.327621 3.03 1106 23068.54 20.85763 7.08 289 11615.46 40.19190 6.82
1 1 1 167.640 96.16150 26 2.20 4.28 20.43 26.91 212 4362.78 20.579151 3.32 899 18630.71 20.72382 7.23 606 26615.60 43.92013 7.55
1 1 1 165.100 59.87414 25 2.33 2.60 3.65 8.58 160 3926.22 24.538875 2.68 856 15314.10 17.89030 7.01 329 12971.06 39.42571 7.30
1 1 1 175.260 74.84268 48 3.02 3.90 16.83 23.75 74 2034.50 27.493243 1.77 559 9313.22 16.66050 7.08 215 7468.76 34.73842 6.64
1 1 1 182.880 95.25432 30 2.72 3.68 18.48 24.88 144 3063.96 21.277500 3.16 578 9246.72 15.99779 6.02 688 27222.44 39.56750 5.41
1 0 1 177.800 61.23492 42 3.66 1.95 18.99 24.60 150 4210.46 28.069733 2.59 248 4168.28 16.80758 6.99 489 21979.21 44.94726 7.10
1 0 2 162.560 108.86208 34 3.15 6.97 58.43 68.55 233 4144.57 17.787854 3.18 1121 18536.38 16.53558 7.10 984 39755.86 40.40230 7.17
1 0 1 165.100 54.43104 25 2.75 3.87 98.65 105.27 123 4426.20 35.985366 3.94 223 4310.84 19.33112 7.85 1346 54531.16 40.51349 6.51
1 1 1 182.880 68.03880 25 2.48 8.25 24.68 35.41 94 2018.92 21.477872 4.15 1055 17342.00 16.43791 7.46 809 30402.00 37.57973 7.37
1 0 2 172.720 68.03880 30 3.74 2.45 15.51 21.70 85 2125.56 25.006588 2.10 341 6527.95 19.14355 6.75 341 14369.54 42.13941 6.70
1 1 1 162.560 85.27530 31 2.63 4.85 46.64 54.12 53 1543.30 29.118868 4.03 426 6725.94 15.78859 7.09 1005 41721.32 41.51375 6.69
1 0 1 193.040 101.15102 28 2.05 4.45 19.55 26.05 78 1932.20 24.771795 3.95 695 11009.42 15.84089 6.87 156 5611.52 35.97128 7.80
1 0 1 157.480 77.11064 44 5.00 3.21 41.80 50.01 359 11353.40 31.625070 2.38 1092 25839.58 23.66262 7.11 1697 96236.76 56.70994 7.38
1 1 1 162.560 68.03880 48 2.39 2.55 17.31 22.25 230 5840.74 25.394522 3.59 701 13269.14 18.92887 7.44 744 32079.13 43.11711 7.95
1 0 1 175.260 75.29627 40 3.88 2.72 19.00 25.60 276 6237.77 22.600616 2.86 535 11180.79 20.89867 6.69 548 26667.10 48.66259 7.12
1 1 1 175.260 65.77084 43 2.82 3.25 15.15 21.22 200 5194.81 25.974050 4.19 727 15065.66 20.72305 6.79 784 49277.83 62.85437 7.30
1 1 1 172.720 71.66754 42 1.84 1.81 3.62 7.27 256 5284.98 20.644453 2.20 793 20236.50 25.51892 6.98 486 25233.77 51.92134 6.76
1 1 1 193.040 111.13004 53 2.64 7.11 22.69 32.44 305 4989.59 16.359312 3.14 794 13304.83 16.75671 6.53 919 35378.86 38.49713 7.08
1 0 1 165.100 111.13004 34 6.33 2.05 17.32 25.70 609 12138.54 19.931921 1.86 716 14797.22 20.66651 7.46 187 7403.14 39.58898 5.93
1 1 2 180.340 72.57472 26 2.43 4.00 26.82 33.25 468 9340.66 19.958675 1.47 742 13286.67 17.90656 4.72 758 30064.37 39.66276 4.77
1 1 2 165.100 81.64656 29 4.16 3.90 50.59 58.65 563 10489.17 18.630853 2.38 482 8095.76 16.79618 5.51 963 50388.00 52.32399 5.18
1 1 1 182.880 90.71840 40 2.54 3.13 32.03 37.70 622 11412.50 18.348071 3.02 1131 21416.04 18.93549 7.29 772 28039.38 36.32044 7.33
1 0 1 157.480 95.25432 52 17.10 5.98 49.59 72.67 1665 33800.28 20.300469 3.13 872 22162.75 25.41600 7.51 2571 112295.79 43.67786 7.87
1 0 1 157.480 51.70949 66 NA NA NA 72.08 NA NA NA NA NA NA NA NA NA NA NA NA
1 1 1 177.800 74.84268 20 2.38 3.75 10.72 16.85 85 2406.32 28.309647 1.49 378 6263.06 16.56894 6.20 433 16052.92 37.07372 5.85
1 1 1 191.770 127.00576 43 2.07 3.95 2.45 8.47 87 2543.90 29.240230 2.99 912 18624.05 20.42111 6.97 137 5963.58 43.52978 6.58
1 1 1 182.880 81.64656 55 4.60 3.52 14.50 22.62 229 4141.03 18.083100 3.60 507 8389.34 16.54702 7.20 470 22093.26 47.00694 7.25
1 1 1 179.070 114.30518 72 1.68 3.37 5.67 10.72 119 2833.09 23.807479 5.93 284 5911.17 20.81398 6.77 143 6487.70 45.36853 6.83
1 0 1 160.020 66.22443 52 2.99 5.71 33.42 42.12 122 3052.61 25.021393 2.48 715 13609.79 19.03467 7.35 715 32398.91 45.31316 6.82
1 1 1 180.340 87.54326 20 2.35 5.87 94.38 102.60 107 3916.87 36.606262 2.72 1200 19256.32 16.04693 6.84 1334 50660.97 37.97674 6.32
1 1 3 175.260 72.57472 29 11.19 5.63 35.93 52.75 NA NA NA NA NA NA NA NA NA NA NA NA
1 0 1 152.400 53.97745 25 3.61 4.70 21.62 29.93 367 8086.87 22.035068 4.16 1115 22601.83 20.27070 7.28 147 5549.72 37.75320 6.89
1 0 1 167.640 68.03880 38 2.39 4.88 2.48 9.75 240 4699.10 19.579583 3.58 906 15142.34 16.71340 7.21 51 1939.82 38.03569 6.55
1 1 1 175.260 97.52228 33 2.81 3.29 21.05 27.15 599 10124.54 16.902404 3.28 828 14741.83 17.80414 6.78 742 27804.89 37.47290 7.24
1 0 1 170.180 74.84268 29 2.72 3.80 23.65 30.17 446 9009.67 20.201054 2.51 883 16151.40 18.29151 7.16 351 13511.02 38.49293 6.56
1 0 1 167.640 57.60618 30 4.25 2.58 38.87 45.70 218 4366.71 20.030780 1.94 352 6635.77 18.85162 6.42 500 17973.59 35.94718 6.73
1 0 1 165.100 67.13162 44 2.73 4.85 39.52 47.10 186 6048.19 32.517150 1.83 807 12659.39 15.68698 7.21 747 28777.56 38.52418 3.92
1 0 1 162.560 65.99764 46 4.58 2.89 37.31 44.78 378 10596.32 28.032593 2.16 1035 19908.89 19.23564 6.92 1618 74847.92 46.25953 7.00
1 0 1 172.720 78.47142 51 9.00 2.40 58.79 70.19 944 19196.54 20.335318 2.56 667 13374.02 20.05100 7.10 2672 117707.52 44.05222 7.55
1 0 1 169.672 58.46801 30 2.74 3.58 39.50 45.82 330 8249.89 24.999667 3.63 394 7021.46 17.82096 7.29 1340 55715.71 41.57889 7.12
1 1 1 190.500 106.95699 34 2.46 4.02 17.22 23.70 175 3596.11 20.549200 2.30 951 18496.45 19.44947 6.72 479 17154.90 35.81399 6.66
1 0 1 157.480 64.68222 57 5.97 2.58 36.80 45.35 170 6737.64 39.633176 2.80 643 11619.54 18.07082 7.71 1173 75326.91 64.21731 7.20
1 1 1 179.070 64.63686 26 4.11 3.50 NA NA 88 1842.84 20.941364 3.24 709 14282.20 20.14415 7.07 203 12705.97 62.59099 6.20
1 1 1 180.340 68.26560 26 3.88 5.30 22.14 31.32 125 2217.59 17.740720 2.65 894 24900.92 27.85338 7.04 604 24827.43 41.10502 6.67
1 0 1 181.864 97.15941 30 3.21 3.05 6.45 12.71 88 3822.61 43.438750 2.96 278 5777.83 20.78356 6.90 211 9811.75 46.50118 6.63
1 0 1 165.100 77.11064 61 4.20 2.67 23.35 30.22 233 5332.35 22.885622 4.85 337 6274.24 18.61792 6.94 598 24831.63 41.52446 6.94
1 1 1 187.960 108.86208 49 3.52 4.62 43.95 52.09 215 5837.64 27.151814 2.58 648 13751.31 21.22116 6.80 1028 47234.62 45.94807 7.25
1 1 1 179.070 102.73859 59 1.87 3.51 33.10 38.48 102 2076.17 20.354608 2.87 613 9712.96 15.84496 6.44 358 17267.23 48.23249 6.31
1 1 3 145.542 77.06528 35 NA NA NA 23.29 NA NA NA NA NA NA NA NA NA NA NA NA
1 0 1 132.080 56.24541 55 4.01 3.57 28.58 36.16 307 5154.94 16.791335 2.00 923 18286.80 19.81235 7.21 698 27490.84 39.38516 7.33
1 1 2 179.070 82.00943 29 3.43 4.19 13.25 20.87 271 5238.33 19.329631 2.91 985 16899.99 17.15735 7.44 427 16841.82 39.44220 7.21
1 1 4 180.340 77.20136 33 2.10 4.32 27.48 33.90 160 3936.15 24.600938 3.34 454 6997.24 15.41242 7.14 460 24274.54 52.77074 6.98
1 1 2 175.260 83.46093 44 3.20 5.95 25.92 35.07 748 12334.89 16.490495 2.94 2375 41122.53 17.31475 7.11 1057 40580.38 38.39203 6.87
1 0 5 163.830 57.96906 38 3.15 3.52 15.03 21.70 414 8505.56 20.544831 3.28 831 13836.50 16.65042 6.68 240 8786.68 36.61117 6.94
1 1 1 187.960 90.71840 28 4.07 3.70 0.70 8.47 70 2355.62 33.651714 2.59 559 9550.59 17.08513 6.65 41 1877.85 45.80122 6.51
1 0 1 171.450 61.59779 21 3.77 6.05 46.10 55.92 NA NA NA NA NA NA NA NA NA NA NA NA
1 0 1 154.940 58.69480 43 3.58 3.63 22.47 29.68 119 2820.22 23.699328 1.98 711 12829.08 18.04371 7.02 816 33248.68 40.74593 7.39
1 0 1 162.560 59.78343 27 4.15 4.75 43.17 52.07 875 18529.84 21.176960 3.60 906 14233.50 15.71026 7.24 2007 82586.08 41.14902 7.26

Look at your data

library(visdat)
vis_dat(smart_pill)

Identifying patterns of missingness

vis_miss(smart_pill)

Identifying patterns of missingness

vis_miss(smart_pill, facet = Group)

Identifying patterns of missingness

library(naniar)
gg_miss_var(smart_pill)

Identifying patterns of missingness

ggplot(smart_pill, aes(x = Age, y = `GE Time`)) +
  geom_miss_point()

Relationships with outcome variable

library(GGally)
smart_pill |>
  mutate(across(c(Group, Gender), as.factor)) |>
  ggbivariate(
    outcome = "GE Time",
    explanatory = c("Group", "Gender", "Height", "Weight", "Age"),
    types = list(comboVertical = "autopoint")
  )

How might you change this plot?

Relationships with outcome variable

smart_pill |>
  mutate(across(c(Group, Gender), as.factor)) |>
  ggbivariate(
    outcome = "Group",
    explanatory = c("Gender", "Height", "Weight", "Age"),
    types = list(comboVertical = "autopoint")
  ) +
  scale_fill_brewer(type = "qual") +
  scale_colour_brewer(type = "qual")

How might you change this plot?

Absolute values or percentages?

Resources

Workshop website

Workshop website: nrennie.rbind.io/training-data-visualisation

Screenshot of course website

RSS Data Visualisation Guide

royal-statistical-society.github.io/datavisguide

Screenshot of data vis guide homepage

Data visualisation resources

Fundamentals of data visualization - clauswilke.com/dataviz


ONS Guidance - service-manual.ons.gov.uk/data-visualisation


DataWrapper Blog - blog.datawrapper.de


R Graphics Cookbook - r-graphics.org


ggplot2: Elegant Graphics for Data Analysis - ggplot2-book.org

Exercises

  • Download the Hypoxia data from causeweb.org/tshs/hypoxia and load it into R.

  • Explore the data.

    • What are the variable types?
    • Are all of the types correct?
    • Is there missing data?
  • What are the relationships with the AHI outcome?