RemainingVotes <- function(V1, V2, VP, rnd = 3){
VT = V1 + V2
VD = abs(V1 - V2)
VRPT = VT/VP
VR = ceiling(VRPT - VT)
NP = (VD + (.5 * VR))/VR
cat(paste0(round(NP * 100, rnd), "% of the remaining vote is required to change the result. \n"))}
Here’s a function to determine how much of a the remaining vote a person needs to win their race by 1 vote. Lets apply it to some ongoing races, using ABCNews’ live updating maps, linked below. I will use Boebert-Frisch, Kelly-Masters, Hobbs-Lake, and Cortez Masto-Laxalt, since those are close races.
https://abcnews.go.com/Elections/2022-us-house-election-results-live-map
https://abcnews.go.com/Elections/2022-us-senate-election-results-live-map
https://abcnews.go.com/Elections/2022-us-governor-election-results-live-map
RemainingVotes(450534, 441546, .88) #Laxalt, Cortez-Masto, proportion of expected votes reported
## 57.389% of the remaining vote is required to change the result.
RemainingVotes(1060031, 944958, .80) #Kelly, Masters
## 72.957% of the remaining vote is required to change the result.
RemainingVotes(1032445, 1005479, .79) #Hobbs, Lake
## 54.978% of the remaining vote is required to change the result.
RemainingVotes(162040, 160918, .99) #Boebert, Frisch
## 84.386% of the remaining vote is required to change the result.
In order of their likelihood of flipping from their current results from least to most likely based on required disproportionality in future votes, we have Frisch beating Boebert, Masters beating Kelly, Cortez-Masto beating Laxalt, and then Lake beating Hobbs.
sessionInfo()
## R version 4.2.1 (2022-06-23 ucrt)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19044)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=English_United States.utf8
## [2] LC_CTYPE=English_United States.utf8
## [3] LC_MONETARY=English_United States.utf8
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United States.utf8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## loaded via a namespace (and not attached):
## [1] digest_0.6.29 R6_2.5.1 jsonlite_1.8.2 magrittr_2.0.3
## [5] evaluate_0.17 stringi_1.7.8 cachem_1.0.6 rlang_1.0.6
## [9] cli_3.4.1 rstudioapi_0.14 jquerylib_0.1.4 bslib_0.4.0
## [13] rmarkdown_2.17 tools_4.2.1 stringr_1.4.1 xfun_0.33
## [17] yaml_2.3.5 fastmap_1.1.0 compiler_4.2.1 htmltools_0.5.3
## [21] knitr_1.40 sass_0.4.2