kuriwaki / cvr_harvard-mit_scripts

6 stars 1 forks source link

[GA] Ware county #318

Closed kuriwaki closed 2 months ago

kuriwaki commented 2 months ago

Both teams have 150 votes too many, spread across mutiple candidates and all its 12 precincts (every precinct has about 1% error, see code below).

The total error rate is 1.05%, so borderline not release

open_dataset("medsl/") |> 
  filter(county_name == "WARE", office == "US PRESIDENT") |> 
  count(precinct) |> 
  collect() |> 
  mutate(precinct = str_to_upper(str_remove(precinct, "[0-9]{3}\\-"))) |>
  count(precinct, wt = n) |>
  tidylog::left_join(
    ## baltz data
    open_dataset("returns/by-precinct-mode/") |> 
      filter(state == "GEORGIA", county_name == "WARE", office == "US PRESIDENT") |> 
      count(precinct, wt = votes, name = "baltz_n") |> 
      collect() 
  ) |> 
  mutate(ratio = n / baltz_n)
precinct n baltz_n ratio
100 2512 2492 1.008026
200A 1712 1666 1.027611
200B 514 503 1.021869
300 2831 2736 1.034722
304 800 798 1.002506
400 2609 2592 1.006559
404 292 288 1.013889
405 481 479 1.004175
406 1195 1188 1.005892
407 362 358 1.011173
408 379 379 1.000000
409 717 713 1.005610