1. Principles of Data visualization
Data visualization plays at least two critical roles in medical and health research. The first, more prominent role is the visualization of research results to support their interpretation. The second, less glamorous role is in the exploration of research data in order to confirm its contents, completeness and quality. In my own work as a statistician, I spend a lot more time making plots, the vast majority of which are never seen by another human, than I do analyzing data with statistical models. This contrasts with what I believe is a common perception that visualizing data is some how tangential or secondary to data analysis. Nothing could be further from the truth and so we will spend a good bit of time on our data visualization skills.
The specific tool we will use for data visualization is the R package ggplot2. However, before we dive into the specifics of code, I was to introduce what I think are the key principles of data visualization that you might think about before actually sitting down to create a particular figure or other visualization.
Design with purpose
- Before you do anything else, decide what you want to convey and be able to explain why. Think about your audience. Once you have that down, only then figure out how to implement your ideas. And don’t let your current knowledge of visualization software dictate your designs. Find and learn the tools that help you create the visualization you want, rather than select visualizations that happen to be facilitated by the tools you already know how to use.
Only include visual elements that support that purpose
- No “chart junk”
Use perceptually accurate visual representations of information
Any statistics/estimates should be presented with visual cues about their uncertainty
Emphasize the key message(s) of the visualization to you audience by using:
Annotations
High contrast visualization
Titles, subtitles, and captions
Show the raw/underlying data where possible
Make sure your visualizations are self-explanatory
Legends/guides/axes labels
Source(s) of data, with dates as relevant
Methods used to produce statistics/estimates
Abbreviations
Units of measurement
Scales
Accessibility
Color choices
Alt text
Corporate identity
Titles
Logos
Colors
Outputs
File formats
Resolutions
Reproducibility
Open code
Links to data when possible