forked from ElectProject/Early-Vote-2020G
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
365 lines (266 loc) · 17.1 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
---
title: "2020 General Election Early Vote Statistics"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(knitr)
library(kableExtra)
library(scales)
library(DT)
library(highcharter)
state_stats <- read_csv("D:/DropBox/Dropbox/Mail_Ballots_2020/markdown/2020G_Early_Vote.csv")
# Setup
party_shell <- data.frame(Party=character(),
Count=integer(),
Percent=double(),
stringsAsFactors=FALSE)
party_shell[1,1] <- "Democrats"
party_shell[2,1] <- "Republicans"
party_shell[3,1] <- "Minor"
party_shell[4,1] <- "No Party Affiliation"
party_shell[5,1] <- "TOTAL"
party_shell_returned <- data.frame(Party=character(),
Count=integer(),
Frequency=double(),
Count2=integer(),
Rate=integer(),
stringsAsFactors=FALSE)
party_shell_returned[1,1] <- "Democrats"
party_shell_returned[2,1] <- "Republicans"
party_shell_returned[3,1] <- "Minor"
party_shell_returned[4,1] <- "No Party Affiliation"
party_shell_returned[5,1] <- "TOTAL"
race_shell <- data.frame(Race=character(),
Count=integer(),
Percent=double(),
stringsAsFactors=FALSE)
race_shell[1,1] <- "Non-Hispanic White"
race_shell[2,1] <- "Non-Hispanic Black"
race_shell[3,1] <- "Hispanic"
race_shell[4,1] <- "Non-Hispanic Asian American"
race_shell[5,1] <- "Non-Hispanic Native American"
race_shell[6,1] <- "Other/Multiple/Unknown"
race_shell[7,1] <- "TOTAL"
gender_shell <- data.frame(Gender=character(),
Count=integer(),
Percent=double(),
stringsAsFactors=FALSE)
gender_shell[1,1] <- "Female"
gender_shell[2,1] <- "Male"
gender_shell[3,1] <- "Unknown"
gender_shell[4,1] <- "TOTAL"
age_shell <- data.frame(Age=character(),
Count=integer(),
Percent=double(),
stringsAsFactors=FALSE)
age_shell[1,1] <- "18 to 24"
age_shell[2,1] <- "25 to 34"
age_shell[3,1] <- "35 to 44"
age_shell[4,1] <- "45 to 54"
age_shell[5,1] <- "55 to 64"
age_shell[6,1] <- "65 and up"
age_shell[7,1] <- "TOTAL"
# National Statistics
US_req_send_party <- party_shell
# Returned or Accepted (depends on how states report data)
US_accept_party <- party_shell_returned
US_accept_party[1,2] <- sum(state_stats$mail_accept_2020_dem)
US_accept_party[2,2] <- sum(state_stats$mail_accept_2020_rep)
US_accept_party[3,2] <- sum(state_stats$mail_accept_2020_minor)
US_accept_party[4,2] <- sum(state_stats$mail_accept_2020_npa)
US_accept_party[5,2] <- sum(state_stats$mail_accept_2020_dem)+sum(state_stats$mail_accept_2020_rep)+sum(state_stats$mail_accept_2020_minor)+sum(state_stats$mail_accept_2020_npa)
US_accept_party[1,4] <- sum(state_stats$mail_sent_req_2020_dem)
US_accept_party[2,4] <- sum(state_stats$mail_sent_req_2020_rep)
US_accept_party[3,4] <- sum(state_stats$mail_sent_req_2020_minor)
US_accept_party[4,4] <- sum(state_stats$mail_sent_req_2020_npa)
US_accept_party[5,4] <- sum(state_stats$mail_sent_req_2020_dem)+sum(state_stats$mail_sent_req_2020_rep)+sum(state_stats$mail_sent_req_2020_minor)+sum(state_stats$mail_sent_req_2020_npa)
US_accept_party$Frequency <- 100*US_accept_party$Count/US_accept_party[5,2]
US_accept_party$Rate <- 100*US_accept_party$Count/US_accept_party$Count2
colnames(US_accept_party) <- c("Party", "Returned Ballots", "Freq. Distribution", "Requested Ballots", "Return Rate")
# Voted
US_voted_party <- party_shell
US_voted_party[1,2] <- sum(state_stats$mail_accept_2020_dem) + sum(state_stats$inperson_2020_dem)
US_voted_party[2,2] <- sum(state_stats$mail_accept_2020_rep) + sum(state_stats$inperson_2020_rep)
US_voted_party[3,2] <- sum(state_stats$mail_accept_2020_minor) + sum(state_stats$inperson_2020_minor)
US_voted_party[4,2] <- sum(state_stats$mail_accept_2020_npa) + sum(state_stats$inperson_2020_npa)
US_voted_party[5,2] <- sum(state_stats$mail_accept_2020_dem)+sum(state_stats$mail_accept_2020_rep)+sum(state_stats$mail_accept_2020_minor)+sum(state_stats$mail_accept_2020_npa) + sum(state_stats$inperson_2020_dem)+sum(state_stats$inperson_2020_rep)+sum(state_stats$inperson_2020_minor)+sum(state_stats$inperson_2020_npa)
US_voted_party$Percent <- 100*US_voted_party$Count/US_voted_party[5,2]
# Inperson
US_inperson_party <- party_shell
US_inperson_party[1,2] <- sum(state_stats$inperson_2020_dem)
US_inperson_party[2,2] <- sum(state_stats$inperson_2020_rep)
US_inperson_party[3,2] <- sum(state_stats$inperson_2020_minor)
US_inperson_party[4,2] <- sum(state_stats$inperson_2020_npa)
US_inperson_party[5,2] <- sum(state_stats$inperson_2020_dem)+sum(state_stats$inperson_2020_rep)+sum(state_stats$inperson_2020_minor)+sum(state_stats$inperson_2020_npa)
US_inperson_party$Percent <- 100*US_inperson_party$Count/US_inperson_party[5,2]
# Requested
US_req_send_party <- party_shell
US_req_send_party[1,2] <- sum(state_stats$mail_sent_req_2020_dem)
US_req_send_party[2,2] <- sum(state_stats$mail_sent_req_2020_rep)
US_req_send_party[3,2] <- sum(state_stats$mail_sent_req_2020_minor)
US_req_send_party[4,2] <- sum(state_stats$mail_sent_req_2020_npa)
US_req_send_party[5,2] <- sum(state_stats$mail_sent_req_2020_dem)+sum(state_stats$mail_sent_req_2020_rep)+sum(state_stats$mail_sent_req_2020_minor)+sum(state_stats$mail_sent_req_2020_npa)
US_req_send_party$Percent <- 100*US_req_send_party$Count/US_req_send_party[5,2]
US_req_send_race <- race_shell
US_req_send_race[1,2] <- sum(state_stats$mail_sent_req_2020_nh_white)
US_req_send_race[2,2] <- sum(state_stats$mail_sent_req_2020_nh_black)
US_req_send_race[3,2] <- sum(state_stats$mail_sent_req_2020_hispanic)
US_req_send_race[4,2] <- sum(state_stats$mail_sent_req_2020_nh_asian)
US_req_send_race[5,2] <- sum(state_stats$mail_sent_req_2020_nh_native_american)
US_req_send_race[6,2] <- sum(state_stats$mail_sent_req_2020_other)
US_req_send_race[7,2] <- sum(state_stats$mail_sent_req_2020_nh_white) +
sum(state_stats$mail_sent_req_2020_nh_black) +
sum(state_stats$mail_sent_req_2020_hispanic) +
sum(state_stats$mail_sent_req_2020_nh_asian) +
sum(state_stats$mail_sent_req_2020_nh_native_american) +
sum(state_stats$mail_sent_req_2020_other)
US_req_send_race$Percent <- 100*US_req_send_race$Count/US_req_send_race[7,2]
US_req_send_age <- age_shell
US_req_send_age[1,2] <- sum(state_stats$mail_sent_req_2020_age1824)
US_req_send_age[2,2] <- sum(state_stats$mail_sent_req_2020_age2534)
US_req_send_age[3,2] <- sum(state_stats$mail_sent_req_2020_age3544)
US_req_send_age[4,2] <- sum(state_stats$mail_sent_req_2020_age4554)
US_req_send_age[5,2] <- sum(state_stats$mail_sent_req_2020_age5564)
US_req_send_age[6,2] <- sum(state_stats$mail_sent_req_2020_age65up)
US_req_send_age[7,2] <- sum(state_stats$mail_sent_req_2020_age1824) +
sum(state_stats$mail_sent_req_2020_age2534) +
sum(state_stats$mail_sent_req_2020_age3544) +
sum(state_stats$mail_sent_req_2020_age4554) +
sum(state_stats$mail_sent_req_2020_age5564) +
sum(state_stats$mail_sent_req_2020_age65up)
US_req_send_age$Percent <- 100*US_req_send_age$Count/US_req_send_age[7,2]
US_req_send_gender <- gender_shell
US_req_send_gender[1,2] <- sum(state_stats$mail_sent_req_2020_female)
US_req_send_gender[2,2] <- sum(state_stats$mail_sent_req_2020_male)
US_req_send_gender[3,2] <- sum(state_stats$mail_sent_req_2020_unk)
US_req_send_gender[4,2] <- sum(state_stats$mail_sent_req_2020_female) +
sum(state_stats$mail_sent_req_2020_male) +
sum(state_stats$mail_sent_req_2020_unk)
US_req_send_gender$Percent <- 100*US_req_send_gender$Count/US_req_send_gender[4,2]
US_state_data <- state_stats %>%
select(state, total_ballots_2016, mail_sent_req_2020, mail_accept_2020)
```
Last updated: `r format(as.POSIXct(Sys.time(), format = "%y%m%d %H:%M"), "%m/%d/%Y %I:%M %p")` Eastern Time
Michael McDonald • Professor, University of Florida
Web: [United States Elections Project](http://www.electproject.org/) • Twitter: [\@ElectProject](https://twitter.com/ElectProject)
Detailed state statistics and analyses for reporting states
[AK](https://electproject.github.io/Early-Vote-2020G/AK.html) | [AL](https://electproject.github.io/Early-Vote-2020G/AL.html) | [AZ](https://electproject.github.io/Early-Vote-2020G/AZ.html) | [CA](https://electproject.github.io/Early-Vote-2020G/CA.html) | [CO](https://electproject.github.io/Early-Vote-2020G/CO.html) | [DC](https://electproject.github.io/Early-Vote-2020G/DC.html) | [FL](https://electproject.github.io/Early-Vote-2020G/FL.html) | [GA](https://electproject.github.io/Early-Vote-2020G/GA.html) | [HI](https://electproject.github.io/Early-Vote-2020G/HI.html) | [IA](https://electproject.github.io/Early-Vote-2020G/IA.html) | [IL](https://electproject.github.io/Early-Vote-2020G/IL.html) | [IN](https://electproject.github.io/Early-Vote-2020G/IN.html) | [KS](https://electproject.github.io/Early-Vote-2020G/KS.html) | [KY](https://electproject.github.io/Early-Vote-2020G/KY.html) | [LA](https://electproject.github.io/Early-Vote-2020G/LA.html) | [MA](https://electproject.github.io/Early-Vote-2020G/MA.html) | [MD](https://electproject.github.io/Early-Vote-2020G/MD.html) | [ME](https://electproject.github.io/Early-Vote-2020G/ME.html) | [MI](https://electproject.github.io/Early-Vote-2020G/MI.html) | [MN](https://electproject.github.io/Early-Vote-2020G/MN.html) | [MS](https://electproject.github.io/Early-Vote-2020G/MS.html) | [MT](https://electproject.github.io/Early-Vote-2020G/MT.html) | [NC](https://electproject.github.io/Early-Vote-2020G/NC.html) | [ND](https://electproject.github.io/Early-Vote-2020G/ND.html) | [NE](https://electproject.github.io/Early-Vote-2020G/NE.html) | [NH](https://electproject.github.io/Early-Vote-2020G/NH.html) | [NJ](https://electproject.github.io/Early-Vote-2020G/NJ.html) | [NM](https://electproject.github.io/Early-Vote-2020G/NM.html) | [NV](https://electproject.github.io/Early-Vote-2020G/NV.html) | [OH](https://electproject.github.io/Early-Vote-2020G/OH.html) | [OK](https://electproject.github.io/Early-Vote-2020G/OK.html) | [OR](https://electproject.github.io/Early-Vote-2020G/OR.html) | [PA](https://electproject.github.io/Early-Vote-2020G/PA.html) | [RI](https://electproject.github.io/Early-Vote-2020G/RI.html) | [SC](https://electproject.github.io/Early-Vote-2020G/SC.html) |
[SD](https://electproject.github.io/Early-Vote-2020G/SD.html) |
[TN](https://electproject.github.io/Early-Vote-2020G/TN.html) |
[TX](https://electproject.github.io/Early-Vote-2020G/TX.html) |
[UT](https://electproject.github.io/Early-Vote-2020G/UT.html) |
[VA](https://electproject.github.io/Early-Vote-2020G/VA.html) |
[VT](https://electproject.github.io/Early-Vote-2020G/VT.html) |
[WA](https://electproject.github.io/Early-Vote-2020G/WA.html) |
[WI](https://electproject.github.io/Early-Vote-2020G/WI.html) |
[WV](https://electproject.github.io/Early-Vote-2020G/WV.html) |
[WY](https://electproject.github.io/Early-Vote-2020G/WY.html)
These states are those where I have recent data on mail ballot activity. More states will be added as state reports become available.
Read my analysis for the week ending:
* [Sunday, Oct.18](https://electproject.github.io/Early-Vote-2020G/Early_Vote_Analysis_10_18.html)
* [Sunday, Oct.11](https://electproject.github.io/Early-Vote-2020G/Early_Vote_Analysis_10_11.html)
* [Sunday, Oct. 4](https://electproject.github.io/Early-Vote-2020G/Early_Vote_Analysis_10_4.html)
* [Sunday, Sept. 27](https://electproject.github.io/Early-Vote-2020G/Early_Vote_Analysis_9_27.html)
## Summary Statistics for Reporting States {.tabset}
### Total Voted
Voters have cast a total of **`r format(as.numeric(sum(state_stats$total_early_2020)), big.mark =",")`** ballots in the reporting states.
``` {r echo = FALSE}
US_2020g_map_data <- state_stats
US_2020g_map_data <- arrange(US_2020g_map_data, hc_order)
hcoptslang <- getOption("highcharter.lang")
hcoptslang$thousandsSep <- ","
options(highcharter.lang = hcoptslang)
US_2020g_map_data <- US_2020g_map_data %>%
mutate(display_data = total_early_2020) %>%
mutate(display_data = na_if(display_data, 0))
hcmap(map = "countries/us/us-all", data = US_2020g_map_data,
value = "display_data", name = "Voted") %>%
hc_title(text ="Total Early Vote") %>%
hc_subtitle(text = "State plots may not be shaded using the same scale")
```
##### {.tabset .tabset-pills}
###### Total Voted
**Total Voted by Party Registration**
Reporting states with party registration data: CA, CO, FL, IA, KS, KY, LA, MD, ME, NC, NE, NJ, NM, NV, OK, PA, SD
``` {r echo = FALSE}
options(knitr.kable.NA = '')
kable(US_voted_party, valign = 't', format.args = list(big.mark = ",", scientific = FALSE), digits = 1) %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
```
###### In-Person Votes
**In-Person Votes by Party Registration**
Reporting states with party registration data: CO, KS, KY, LA, MD, NC, NM, NV, SD
``` {r echo = FALSE}
options(knitr.kable.NA = '')
kable(US_inperson_party, valign = 't', format.args = list(big.mark = ",", scientific = FALSE), digits = 1) %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
```
###### Returned Mail Ballots
**Returned Mail Ballots by Party Registration**
Reporting states with party registration data: CA, CO, FL, IA, KS, KY, MD, ME, NC, NE, NJ, NM, NV, OK, PA, SD
``` {r echo = FALSE}
options(knitr.kable.NA = '')
kable(US_accept_party, valign = 't', format.args = list(big.mark = ",", scientific = FALSE), digits = 1) %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
```
### Turnout as Percent of 2016 Total Turnout
Nationally, voters have cast **`r paste(round(100*sum(state_stats$total_early_2020)/sum(state_stats$total_ballots_2016), digits = 1),"%", sep = "")`** of the total votes counted in the 2016 general election.
``` {r echo = FALSE}
US_2020g_map_data <- state_stats
US_2020g_map_data <- arrange(US_2020g_map_data, hc_order)
US_2020g_map_data <- US_2020g_map_data %>%
mutate(display_data = round(100*total_early_2020/total_ballots_2016, digits = 1)) %>%
mutate(display_data = na_if(display_data, 0))
hcmap(map = "countries/us/us-all", data = US_2020g_map_data,
value = "display_data", name = "Percent") %>%
hc_title(text ="Total Votes Cast as Percent of 2016 Total Turnout") %>%
hc_subtitle(text = "State plots may not be shaded using the same scale")
```
### Mail Ballots Requested
Voters have requested a total of **`r format(as.numeric(sum(state_stats$mail_sent_req_2020)), big.mark =",")`** ballots in the reporting states.
``` {r echo = FALSE}
US_2020g_map_data <- state_stats
US_2020g_map_data <- arrange(US_2020g_map_data, hc_order)
hcoptslang <- getOption("highcharter.lang")
hcoptslang$thousandsSep <- ","
options(highcharter.lang = hcoptslang)
US_2020g_map_data <- US_2020g_map_data %>%
mutate(display_data = mail_sent_req_2020) %>%
mutate(display_data = na_if(display_data, 0))
hcmap(map = "countries/us/us-all", data = US_2020g_map_data,
value = "display_data", name = "Requested Ballots") %>%
hc_title(text ="Mail Ballots Requested") %>%
hc_subtitle(text = "State plots may not be shaded using the same scale")
```
#### Mail Ballots Requested by Party Registration
Reporting states with party registration data: CA, CO, DC, FL, IA, MD, ME, NC, NJ, NM, NV, OR, PA, UT
``` {r echo = FALSE}
options(knitr.kable.NA = '')
kable(US_req_send_party, valign = 't', format.args = list(big.mark = ",", scientific = FALSE), digits = 1) %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
```
Registered Democrats have a **`r format(as.numeric(US_req_send_party[1,2]-US_req_send_party[2,2]), big.mark =",")`** ballot request lead over registered Republicans.
*Note:* Party registration statistics are for states that have party registration. These statistics are not actual votes. By federal law, election officials do not begin counting ballots until Election Day, although they may start the process of preparing ballots for counting in advance.
#### Mail Ballots Requested by Race and Ethnicity
Reporting states with race or ethnicity data: NC, SC
``` {r echo = FALSE}
options(knitr.kable.NA = '')
kable(US_req_send_race, valign = 't', format.args = list(big.mark = ",", scientific = FALSE), digits = 1) %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
```
*Note:* Race and ethnicity statistics are for states that ask registered voters to provide their race and ethnicity.
#### Mail Ballots Requested by Age
Reporting states with age data: CO, OH (partial), PA
``` {r echo = FALSE}
kable(US_req_send_age, format.args = list(big.mark = ",",
scientific = FALSE), digits = 1) %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
```
#### Mail Ballots Requested by Gender
Reporting states with gender data: CO, NC
``` {r echo = FALSE}
kable(US_req_send_gender, format.args = list(big.mark = ",",
scientific = FALSE), digits = 1) %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
```