Overview

Voting is an important civic duty in a democracy. Registered voters can participate in federal, state, and local elections. Presidential elections, held every 4 years, are important major national events. There are many get out the vote campaigns preceded by voter registration drives. While voter registrations for the 2020 election cycle was exceeding the corresponding 2016 election cycle, the COVID-19 global pandemic has adversely affected this process (Rogers & Rakich, 2020).

Reference: Rogers, K., & Rakich, N. (2020, Jun 26). Voter registrations are way, way down during the pandemic. Retrieved from https://fivethirtyeight.com/features/voter-registrations-are-way-way-down-during-the-pandemic/.

theURL <- "https://raw.githubusercontent.com/fivethirtyeight/data/master/voter-registration/new-voter-registrations.csv"

new_voter_regs_DF <- read.table(file=theURL, header=TRUE, sep=",")

dim(new_voter_regs_DF)
## [1] 106   4
str(new_voter_regs_DF)
## 'data.frame':    106 obs. of  4 variables:
##  $ Jurisdiction         : chr  "Arizona" "Arizona" "Arizona" "Arizona" ...
##  $ Year                 : int  2016 2016 2016 2016 2020 2020 2020 2020 2016 2016 ...
##  $ Month                : chr  "Jan" "Feb" "Mar" "Apr" ...
##  $ New.registered.voters: int  25852 51155 48614 30668 33229 50853 31872 10249 87574 103377 ...
head(new_voter_regs_DF)
##   Jurisdiction Year Month New.registered.voters
## 1      Arizona 2016   Jan                 25852
## 2      Arizona 2016   Feb                 51155
## 3      Arizona 2016   Mar                 48614
## 4      Arizona 2016   Apr                 30668
## 5      Arizona 2020   Jan                 33229
## 6      Arizona 2020   Feb                 50853
tail(new_voter_regs_DF)
##     Jurisdiction Year Month New.registered.voters
## 101     Virginia 2016   May                 26239
## 102     Virginia 2020   Jan                 25934
## 103     Virginia 2020   Feb                 29507
## 104     Virginia 2020   Mar                 31492
## 105     Virginia 2020   Apr                  5467
## 106     Virginia 2020   May                  8239
#new_voter_regs_DF

Data Munging

Changed Jurisdiction to State and “New Registered Voters” to “New Voter Regs”. Modifed Month to include numeric for calendar sequence.

colnames(new_voter_regs_DF)<-c("State","Year","Month","NewVoterRegs")
head(new_voter_regs_DF)
##     State Year Month NewVoterRegs
## 1 Arizona 2016   Jan        25852
## 2 Arizona 2016   Feb        51155
## 3 Arizona 2016   Mar        48614
## 4 Arizona 2016   Apr        30668
## 5 Arizona 2020   Jan        33229
## 6 Arizona 2020   Feb        50853
# sequence month in calendar order
vec <- new_voter_regs_DF$Month

SeqMonth  <- function(vec) {
  newvec <- vec
  for (i in 1:length(vec)) {
    if(vec[i] == "Jan") {
      newvec [i] <- "01:Jan"
    }else if(vec[i] == "Feb") {
      newvec [i] <- "02:Feb"
    }else if(vec[i] == "Mar") {
      newvec [i] <- "03:Mar"
    }else if(vec[i] == "Apr") {
      newvec [i] <- "04:Apr"
    }else if(vec[i] == "May") {
      newvec [i] <- "05:May"
    }else if(vec[i] == "Jun") {
      newvec [i] <- "06:Jun"
    }else if(vec[i] == "Jul") {
      newvec [i] <- "07:Jul"
    }else if(vec[i] == "Aug") {
      newvec [i] <- "08:Aug"
    }else if(vec[i] == "Sep") {
      newvec [i] <- "09:Sep"
    }else if(vec[i] == "Oct") {
      newvec [i] <- "10:Oct"
    }else if(vec[i] == "Noc") {
      newvec [i] <- "11:Nov"
    }else if(vec[i] == "Dec") {
      newvec [i] <- "12:Dec"
    }else {
      newvec [i] <- "00-???"
    }
  }
#  print (newvec)
  return(vec <-newvec)
}

new_voter_regs_DF$Month <- (SeqMonth(vec))

Subsetting - Extract 2016 New Voter Registration data

In preparation for graphing, extract 2016 data

# subset some data
df_2016nvr <- subset(new_voter_regs_DF, Year==2016)
head(df_2016nvr)
##         State Year  Month NewVoterRegs
## 1     Arizona 2016 01:Jan        25852
## 2     Arizona 2016 02:Feb        51155
## 3     Arizona 2016 03:Mar        48614
## 4     Arizona 2016 04:Apr        30668
## 9  California 2016 01:Jan        87574
## 10 California 2016 02:Feb       103377

January through May 2016 New Voter Registrations Line Plots

These line plots show the January through May 2016 New Voter Registrations by State.

g <- ggplot(data=df_2016nvr, aes(x=Month, y=NewVoterRegs))
g <- g + geom_line(aes(color=factor(State), group=State))
g <- g + scale_color_discrete(name="State")
g <- g + scale_y_continuous(labels=comma)
g <- g + labs(title="2016 New Voter Registrations by State", x="Month", y="New Voter Registrations")
g

Subsetting - Extract 2020 New Voter Registration data

In preparation for graphing , extract 2020 data

# subset some data
df_2020nvr <- subset(new_voter_regs_DF, Year==2020)
head(df_2020nvr)
##         State Year  Month NewVoterRegs
## 5     Arizona 2020 01:Jan        33229
## 6     Arizona 2020 02:Feb        50853
## 7     Arizona 2020 03:Mar        31872
## 8     Arizona 2020 04:Apr        10249
## 13 California 2020 01:Jan       151595
## 14 California 2020 02:Feb       238281

January through May 2020 New Voter Registrations Line Plots

These line plots show the January through May 2020 New Voter Registrations by State.

g <- ggplot(data=df_2020nvr, aes(x=Month, y=NewVoterRegs))
g <- g + geom_line(aes(color=factor(State), group=State))
g <- g + scale_color_discrete(name="State")
g <- g + scale_y_continuous(labels=comma)
g <- g + labs(title="2020 New Voter Registrations by State", x="Month", y="New Voter Registrations")
g

Subsetting - Extract May 2020 New Voter Registration data

However, only the following 5 States out of 12 reported New Voter Registration data in May 2020.

# subset some data
df_May2020nvr <- subset(new_voter_regs_DF, Year==2020 & Month == "05:May")
head(df_May2020nvr)
##                    State Year  Month NewVoterRegs
## 42  District of Columbia 2020 05:May         1925
## 76              Maryland 2020 05:May        23488
## 86        North Carolina 2020 05:May        23517
## 96                 Texas 2020 05:May        35678
## 106             Virginia 2020 05:May         8239

Conclusions

The COVID-19 Global Pandemic has had a substantial adverse affect on new voter registrations in 2020. While January and February appear comparable in 2016 and 2020, there is a substantial drop in new voter registrations beginning in March 2020 coinciding with emergency federal, state, and local executive actions related to flattening the curve of COVID-19 cases.

As COVID-19 cases within the U.S. and around the globe increased in March through May, one can see the dramatic rise in cases from this Johns Hopkins Coronavirus Critical Trends Graph https://coronavirus.jhu.edu/data/new-cases. One can also observe the trend in confirmed cases by state https://coronavirus.jhu.edu/data/new-cases-50-states.