class: inverse, center, middle # 36-315: Statistical Graphics and Visualization ## Lecture 11 Meghan Hall <br> Department of Statistics & Data Science <br> Carnegie Mellon University <br> June 16, 2021 --- layout: true <div class="my-footer"><span>cmu-36315.netlify.app</span></div> --- # From last time <br> .large[Extensions to `ggplot2`] <br> .medium[in addition to the ones we've already covered] <br> .large[New plot types *and* new techniques for details] --- # Today <br> .large[Different lecture than usual!] <br> <br> .large[Midterm logistics & tips] <br> .medium[expectations for plots] <br> .large[Live coding with a new dataset] <br> .medium[with questions] --- # Midterm logistics <br> .large[Available at 5pm Wednesday, due 5am Friday] <br> .medium[**EDT**] <br> .large[Logistically works like a homework assignment] <br> .medium[submit on Gradescope] <br> .large[Data source] <br> .medium[files on Canvas are a last resort] --- .left[# Midterm logistics] .pull-left[ ### Allowed <br> Class materials <br> Notes <br> Documentation/resources ] -- .pull-left[ ### Not allowed <br> Piazza <br> Talking with classmates <br> Talking with *anyone* about the exam* ] --- # You're prepared if... <br> <br> .large[You've watched/attended lectures] <br> <br> .large[You understand the lab/homework questions] <br> <br> .large[You're familiar with viewing documentation & how to debug] --- .left[# Data manipulation techniques] .center[**non-exhaustive list**] .pull-left[ <br> <br> .large[Creating new variables] <br> .medium[maybe with `paste0` to create strings]<br> <br> .large[Aggregating data] <br> .medium[`group_by` + `summarize`]<br> ] .pull-right[ <br> <br> .large[Joining with `left_join`] <br> .medium[maybe with two key variables instead of just one]<br> <br> .large[Pivoting data] <br> .medium[`pivot_wider` and `pivot_longer`]<br> ] --- # Overall tips .large[Take time to look at your data first] <br> <br> .large[Remember you can control variable type] <br> .medium[with `as.character` and `as.numeric`]<br> <br> .large[Notice what rates are being asked for] <br> .medium[like with the TB case rates in HW 3]<br> <br> .large[Remember there are multiple solutions!] <br> .medium[we've covered different ways to relabel values, highlight points, annotate graphs, etc.]<br> --- .left[# Guidelines for plots] .pull-left[ .large[Follow the guidelines we've discussed] <br> .medium[everything must be readable, etc.]<br> <br> .large[Use appropriate color scales] <br> <br> .large[Use a good, explanatory title] <br> ] .pull-right[ .large[If you need a legend, make it look nice] <br> <br> .large[Order bars/geoms in an appropriate fashion] <br> <br> .large[Use appropriate axis titles] ] --- # Schedule <br> .large[Midterm available at 5pm today, due 5am Friday] <br> .large[Homework 4 due Tuesday June 22] <br> .large[Will start discussing final projects next week] --- class: inverse, center, middle # To RStudio!