time · figure 8. 30 in alberto cairo's the truthful art: map of the spread of walmart by...
TRANSCRIPT
![Page 1: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/1.jpg)
Time
Session 11PMAP 8921: Data Visualization with R
Andrew Young School of Policy StudiesMay 2020
1 / 31
![Page 2: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/2.jpg)
Plan for today
Axis issues
Visualizing time
Starting, ending,and decomposing time
2 / 31
![Page 3: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/3.jpg)
Axis issues
3 / 31
![Page 4: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/4.jpg)
Is truncating the y-axis misleading?
4 / 31
![Page 5: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/5.jpg)
Don't be too extreme!
It is actually more legal totruncate the y-axis than you might think!
When small movements matter
When the scale itself is distorted
When zero values are impossible
5 / 31
![Page 6: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/6.jpg)
When is it okay to truncate?When small movements matter
6 / 31
![Page 7: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/7.jpg)
When is it okay to truncate?When the scale itself is distorted
7 / 31
![Page 8: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/8.jpg)
When is it okay to truncate?When zero values are impossible
8 / 31
![Page 9: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/9.jpg)
Never on bar charts
9 / 31
![Page 10: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/10.jpg)
Zero is okay too!
Just because you don't have to start at 0doesn't mean you should never start at 0
It's often a good idea!
10 / 31
![Page 11: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/11.jpg)
Keep axis scales consistent
FOX affiliate in Colorado reporting on COVID-19 cases
11 / 31
![Page 12: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/12.jpg)
Keep axis scales consistent
12 / 31
![Page 13: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/13.jpg)
Don’t impute across categories
13 / 31
![Page 14: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/14.jpg)
Visualizing time
14 / 31
![Page 15: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/15.jpg)
Showing changes over timeTime is just a variable that can be mapped to an aesthetic
Can be used as x, y, color, fill, facet, and even animation
Can use all sorts of geom s:lines, columns, points, heatmaps, densities, maps, etc.
In general, follow reading conventions to show time progression:
→ & ↓15 / 31
![Page 16: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/16.jpg)
Front page of the New York Times, May 9, 2020
Time on x-axis + geom_line/col()
16 / 31
![Page 17: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/17.jpg)
Time on x-axis + geom_tile()
Figure 8.28 in Alberto Cairo's The Truthful Art: Heat map by Jorge Camões
17 / 31
![Page 18: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/18.jpg)
Time on y-axis + geom_density()
18 / 31
![Page 19: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/19.jpg)
Time in animation + geom_point()
19 / 31
![Page 20: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/20.jpg)
Time in maps
Figure 8.30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões20 / 31
![Page 21: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/21.jpg)
Time in geom_col() + small multiples
Kieran Healy, “The Kitchen Counter Observatory”
21 / 31
![Page 22: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/22.jpg)
Don't go wild with time mapping!
Tornado plot: When a curve crosses the left of the central axis, the number of deaths per day falls22 / 31
![Page 23: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/23.jpg)
Interpreting tornado plots
23 / 31
![Page 24: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/24.jpg)
Better with multiple plots
24 / 31
![Page 25: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/25.jpg)
Starting, ending,and decomposing time
25 / 31
![Page 26: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/26.jpg)
∞
You always have to choosea start and end point
Start and end at reasonable times thathelp maintain the context of the story
26 / 31
![Page 27: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/27.jpg)
Measles vaccine was pretty effective!
27 / 31
![Page 28: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/28.jpg)
Measles vaccine was incredible!
28 / 31
![Page 29: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/29.jpg)
SeasonalityDon't mistake seasonality for actual trends
29 / 31
![Page 30: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/30.jpg)
Decomposition
30 / 31
![Page 31: Time · Figure 8. 30 in Alberto Cairo's The Truthful Art: Map of the spread of Walmart by Jorge Camões ÿ x . Time in geom_col() + small multiples Kieran Healy, “ The Kitchen Counter](https://reader033.vdocuments.us/reader033/viewer/2022050421/5f908352404b1f58f770bbad/html5/thumbnails/31.jpg)
Birthday decomposition
Cover of Andrew Gelman, et al., Bayesian Data Analysis31 / 31