class: center, middle, inverse, title-slide # Data Visualization ## Look at Data ### Andrew Irwin,
a.irwin@dal.ca
### Math & Stats, Dalhousie University ### 2021-01-11 (updated: 2021-01-01) --- class: middle # Principles of data visualization * What can you learn more easily from a visualization than from a table of data? * What makes a visualization good? * What features of human visual perception should be considered when designing data visualizations? ??? This is an overview to a vast range of concerns that you will ask yourself over and over again. Strongly suggesting reading Healy & Wilke on this. Suggested reading at end. --- class: middle, center, inverse # Why visualize data? --- class: middle, center # Anscombe's Quartet <table class="table" style="width: auto !important; margin-left: auto; margin-right: auto;"> <thead> <tr> <th style="text-align:left;"> set </th> <th style="text-align:right;"> n </th> <th style="text-align:right;"> x_mean </th> <th style="text-align:right;"> x_sd </th> <th style="text-align:right;"> y_mean </th> <th style="text-align:right;"> y_sd </th> <th style="text-align:right;"> correlation </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> 1 </td> <td style="text-align:right;"> 11 </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 3.316625 </td> <td style="text-align:right;"> 7.500909 </td> <td style="text-align:right;"> 2.031568 </td> <td style="text-align:right;"> 0.8164205 </td> </tr> <tr> <td style="text-align:left;"> 2 </td> <td style="text-align:right;"> 11 </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 3.316625 </td> <td style="text-align:right;"> 7.500909 </td> <td style="text-align:right;"> 2.031657 </td> <td style="text-align:right;"> 0.8162365 </td> </tr> <tr> <td style="text-align:left;"> 3 </td> <td style="text-align:right;"> 11 </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 3.316625 </td> <td style="text-align:right;"> 7.500000 </td> <td style="text-align:right;"> 2.030424 </td> <td style="text-align:right;"> 0.8162867 </td> </tr> <tr> <td style="text-align:left;"> 4 </td> <td style="text-align:right;"> 11 </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 3.316625 </td> <td style="text-align:right;"> 7.500909 </td> <td style="text-align:right;"> 2.030578 </td> <td style="text-align:right;"> 0.8165214 </td> </tr> </tbody> </table> --- class: middle, center # Anscombe's Quartet <img src="04-look-at-data_files/figure-html/unnamed-chunk-2-1.png" style="display: block; margin: auto;" /> --- class: middle, center # Datasaurus Dozen <div class="figure" style="text-align: center"> <img src="../static/datasaurus.gif" alt="The Datasaurus Dozen" width="55%" /> <p class="caption">The Datasaurus Dozen</p> </div> --- class: middle, center, inverse # What is a good visualization? --- class: middle <div class="figure" style="text-align: center"> <img src="../static/cbc-2019-oct-21-election.jpg" alt="Still from CBC Canadian Federal election coverage, October 21, 2019. Does the three-dimensional bar chart help you understand the election outcome? Are the bars the right height? Is it helpful to have the bar chart appear in the middle of the studio set? Can you judge the height of the bars?" width="75%" /> <p class="caption">Still from CBC Canadian Federal election coverage, October 21, 2019. Does the three-dimensional bar chart help you understand the election outcome? Are the bars the right height? Is it helpful to have the bar chart appear in the middle of the studio set? Can you judge the height of the bars?</p> </div> ??? A good visualization leads the viewer to a correct interpretation of the underlying data. --- class: middle <img src="../static/time-survey.jpeg" width="1280" /> ??? Bad data. Or more realistically, the data are not what the reader thinks they are. --- class: middle, center, inverse # Visual perception --- class: middle .pull-left[ <img src="../static/ch-01-channels-for-cont-data-vertical-A.png" width="80%" /> ] .pull-right[ <div class="figure"> <img src="../static/ch-01-channels-for-cont-data-vertical-B.png" alt="Healy. Fig. 1.24." width="80%" /> <p class="caption">Healy. Fig. 1.24.</p> </div> ] ??? distance, postition, area, shape --- class: middle # Proportions: bar and pie charts <div class="figure"> <img src="../static/marketshare-pies-1.png" alt="Wilke. Fig. 10.4." width="80%" /> <p class="caption">Wilke. Fig. 10.4.</p> </div> ??? --- class: middle # Proportions: bar and pie charts <div class="figure"> <img src="../static/marketshare-side-by-side-1.png" alt="Wilke. Fig. 10.6." width="80%" /> <p class="caption">Wilke. Fig. 10.6.</p> </div> --- class: middle <div class="figure"> <img src="../static/checker-shadow-illusion.jpg" alt="The checker shadow illusion." width="100%" /> <p class="caption">The checker shadow illusion.</p> </div> --- class: middle <div class="figure"> <img src="../static/checker-shadow-illusion-selected2.jpg" alt="The checker shadow illusion." width="100%" /> <p class="caption">The checker shadow illusion.</p> </div> --- class: middle <div class="figure"> <img src="../static/checker-shadow-illusion-selected3.jpg" alt="The checker shadow illusion." width="100%" /> <p class="caption">The checker shadow illusion.</p> </div> --- class: middle # Where to put 0? <div class="figure"> <img src="../static/ch-01-law-enrollments-1.png" alt="Healy. Fig. 1.27." width="80%" /> <p class="caption">Healy. Fig. 1.27.</p> </div> --- class: middle # Where to put 0? <div class="figure"> <img src="../static/ch-01-law-enrollments-2.png" alt="Healy. Fig. 1.27." width="80%" /> <p class="caption">Healy. Fig. 1.27.</p> </div> --- class: middle # Suggested reading * Course notes: Look at Data * Healy. Chapter 1: Look at Data (Strongly recommended) * Wilke. Chapter 1: Introduction * Wilke. Chapters 5-16: "Visualizing" series of chapters. Return to these over time. --- class: middle, inverse # Task * Task 3: Answer 2 questions about data visualization * Use arguments provided in the lessons and readings * You can agree or disagree, but you must engage with the ideas