Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2016 general precinct discrepancies #52

Open
2 tasks done
dwillis opened this issue Jun 16, 2018 · 6 comments
Open
2 tasks done

2016 general precinct discrepancies #52

dwillis opened this issue Jun 16, 2018 · 6 comments
Labels

Comments

@dwillis
Copy link
Contributor

dwillis commented Jun 16, 2018

Compared to county-level totals.

  • Dutchess - Clinton has 9 more DEM votes than county totals
  • Essex - has both town and precinct rows, need to remove the former.
@jamesdunham
Copy link
Contributor

jamesdunham commented Jun 16, 2018

Here's what I've found so far:

  • For St. Lawrence, drop rows where precinct is TOTAL
  • In Essex, drop the total row for each town's precincts, indicated e.g. by precinct of Ticonderoga, after Ticonderoga 1, Ticonderoga 2
  • Similarly, in Niagara, we have Wilson/000/1, Wilson/000/2, ... Wilson/000
  • In Columbia, mode votes = AbsenteeAffidavit + ElectionDayVotes
  • Same in Herkimer, but votes = absentee_affidavit + polling_place
  • In Lewis and Seneca, absentee + election_day = votes
  • Finally, drop where candidate or vote mode matches total; and where precinct matches cumulative|total
  • In NYC counties, drop where candidate is Public Counter
  • St. Lawrence data are wide, with columns votes, machine_votes, absentee, absentee_hc, and affidavit. The first of these is the sum of the others.

@jamesdunham
Copy link
Contributor

jamesdunham commented Jun 16, 2018

After the steps in my previous comment, I get this:

   jurisdiction            party votes.precincts votes.counties vote_diff
1:     Dutchess       democratic           58919          58910         9
2:      Ontario       democratic           21055          21062        -7
3:      Ontario working families             798            799        -1
4:     Schuyler       democratic            2814           2817        -3
5:       Seneca             <NA>               1             NA        NA
6:      Steuben             <NA>            1313             NA        NA
7:      Steuben       democratic           10718          11982     -1264
8:      Steuben women's equality             136            155       -19
9:      Steuben working families             359            389       -30

The totals in Steuben County are correct, but 1,313 absentee votes in the precinct data aren't associated with a party. In the state canvass, they've been assigned parties. So the discrepancies are in Dutchess, Ontario, Schuyler, and Seneca.

@dwillis
Copy link
Contributor Author

dwillis commented Jun 17, 2018

Looked at Dutchess recanvass and the Clinton Dem total is now 58933, which is 23 more than state's total for the county.

@jamesdunham
Copy link
Contributor

Dutchess looks good now. With 5a482c4, we also have 58,933.

   jurisdiction            party votes.precincts votes.counties vote_diff
1:     Dutchess       democratic           58933          58910        23
2:      Ontario       democratic           21055          21062        -7
3:      Ontario working families             798            799        -1
4:     Schuyler       democratic            2814           2817        -3
5:       Seneca             <NA>               1             NA        NA
6:      Steuben             <NA>            1313             NA        NA
7:      Steuben       democratic           10718          11982     -1264
8:      Steuben women's equality             136            155       -19
9:      Steuben working families             359            389       -30

@jamesdunham
Copy link
Contributor

jamesdunham commented Jun 17, 2018

Here's another pass through the NY returns more broadly, using 5a482c4: gist.

# Public Counter
d[candidate %=% 'Public Counter', unique(county)]
# [1] "Bronx"    "New York" "Queens"   "Richmond"

# `total` in candidate field
unique(d[candidate %=% 'total', .(county, candidate)])
#         county             candidate
#  1:     Cayuga   Total Special Votes
#  2:     Cayuga           Total Votes
#  3:    Chemung                 Total
#  4:   Chenango                 Total
#  5:   Delaware                 Total
#  6:       Erie                 Total
#  7:   Franklin                 Total
#  8:    Genesee                 Total
#  9:  Jefferson                 Total
# 10:      Lewis                 Total
# 11: Livingston                 Total
# 12:     Monroe                 Total
# 13:     Orange      Total Votes Cast
# 14:    Orleans                 Total
# 15:     Putnam                 Total
# 16:  Schoharie   Total Special Votes
# 17:  Schoharie           Total Votes
# 18:     Seneca                 Total
# 19:    Steuben Total Enrolled Voters
# 20:   Sullivan                 Total
# 21:    Wyoming                 Total
# 22:      Yates                 Total
#         county             candidate

# In Niagara, we have "Wilson/000/1", "Wilson/000/2", ... "Wilson/000"
d[(county == 'Niagara' & str_count(precinct, '\\/') == 1), unique(precinct)]
#  [1] "Cambria/000"          "City of Lockport/001" "City of Lockport/002"
#  [4] "City of Lockport/003" "City of Lockport/004" "City of Lockport/005"
#  [7] "Hartland/000"         "Lewiston/000"         "N Tonawanda/001"     
# [10] "N Tonawanda/002"      "N Tonawanda/003"      "Newfane/000"         
# [13] "Niagara Falls/003"    "Niagara Falls/004"    "Niagara Falls/005"   
# [16] "Niagara Falls/006"    "Pendleton/000"        "Porter/000"          
# [19] "Royalton/000"         "Somerset/000"         "Lockport/000"        
# [22] "Niagara/000"          "Wheatfield/000"       "Wilson/000"          

# In Columbia, mode "votes" = "AbsenteeAffidavit" + "ElectionDayVotes"
d[county == 'Columbia', unique(mode)]
# [1] "votes"        "election_day" "absentee"    

# Same in Herkimer, but "votes" = "absentee_affidavit" + "polling_place"
d[county == 'Herkimer', unique(mode)]
# [1] "votes"        "election_day" "absentee"    

# In Lewis and Seneca, "absentee" + "election_day" = "votes"
d[county %in% c('Lewis', 'Seneca'), unique(mode)]
# [1] "votes"        "election_day" "absentee"    

# In St. Lawrence, mode "votes" = "machine_votes" + "absentee" + "affidavit" + "absentee_hc"
d[county == 'St. Lawrence', unique(mode)]
# [1] "votes"         "absentee"      "machine_votes" "absentee_hc"  
# [5] "affidavit"    

unique(d[precinct %=% 'cumulative|total', .(county, precinct)]) 
#         county            precinct
#  1:      Lewis              TOTALS
#  2:    Madison               TOTAL
#  3: Montgomery               Total
#  4:     Nassau               Total
#  5:     Oneida               Total
#  6:   Onondaga      Syracuse Total
#  7:   Onondaga Onondaga Town Total
#  8:   Onondaga               Total
#  9:    Ontario               Total
# 10:    Orleans               TOTAL
# 11:     Oswego               Total
# 12:     Otsego               TOTAL
# 13:   Rockland               Total
# 14:   Saratoga               Total
# 15:   Schuyler          Cumulative
# 16:   Schuyler               Total
# 17:     Seneca          Cumulative
# 18:     Seneca               TOTAL
# 19:   Tompkins               Total
# 20:     Ulster               Total

unique(d[precinct == '', .(county, precinct)]) 
#     county precinct
# 1:   Wayne         
# 2: Wyoming         

# Ballots cast...
d[candidate %=% 'ballots cast', unique(county)]
# [1] "Niagara"      "Schenectady"  "St. Lawrence"

@dwillis
Copy link
Contributor Author

dwillis commented Jun 23, 2018

I've gone through and removed the total rows from the counties mentioned above. I'm not sure what the issue is with Steuben - it looks like the county total file is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants