kuriwaki / cvr_harvard-mit_scripts

6 stars 1 forks source link

Counties where tiny vote discrepancies lead to > 1% discrepancy #344

Open kuriwaki opened 2 weeks ago

kuriwaki commented 2 weeks ago

A discrepancy of 200 votes to 203 votes is 1.5%, which gets caught in our 1% criteria. However, these are quite small vote discrepancies, and often votes for small parties.

We could make an exception to the 1% rule if, say, the absolute difference is only 3 votes or less. That would release 8 more counties (see the max_diff column here) I think:

image
read_excel("compare.xlsx", sheet = 3) |>
  filter(release == 0, state != "DISTRICT OF COLUMBIA") |>
  mutate(diff = abs(votes_v - votes_c),
         diff_pct = abs(votes_v - votes_c) / votes_v) |>
  mutate(n_voters = sum(votes_v[office == "US PRESIDENT"], na.rm = TRUE), .by = c(state, county_name)) |>
  # discrepancies that are flagged
  filter(diff_pct >= 0.01) |>
  # largest discrepancy
  summarize(
    max_diff = max(diff),
    max_disc = max(diff_pct),
    .by = c(state, county_name, n_voters)) |>
  # sort from small to large
  arrange(max_diff) |> 
  print(n = 20)