Hang out with the TAs from STA 199! This is a casual conversation and a fun opportunity to meet the members of the STA 199 teaching team. The only rule is these can’t turn into office hours!
Tea with a TA counts as a statistics experience.
Caroline Levenson, TODAY 1p - 2p
If you’re eligible, VOTE! Find out more information: https://vote.duke.edu/
Electronic Undergraduate Statistics Research Conference (eUSR) Nov 6, 11:30a - 4:40p
Click here for slides.
Today’s data set comes from the US Elections Project. We will focus specifically on early voting data for North Carolina as of November 1, 2020.
The variables are
name
: county nameregstrd
: number of registered votersvoted
: number of individuals who have votedmailed
: number of mail ballots returned and acceptedrejectd
: number of mail ballots rejectedml_rqst
: number of mail ballots requestedWe first read in the file nc_votes_nov1.shp
with the st_read
function, saving as nc_votes
.
nc_votes <- st_read("data/nc_votes_nov1.shp", quiet = TRUE)
Examine the data frame nc_votes_nov1
. How does it differ from the data frames we have seen before? What type of geometry is associated with each simple feature?
Let’s use nc_votes
to create a map of North Carolina.
ggplot(nc_votes) +
geom_sf()
Starting with the code above, update the visualization so that the counties have a fill color corresponding to the percentage of requested mail-in ballots that have been returned and accepted. Include informative labels, colors and any other aesthetics.
Create an effective spatial data visualization using these data exploring a topic of your choosing.
Read more about factors to consider when creating election maps: https://www.nytimes.com/interactive/2020/10/30/opinion/election-results-maps.html