Writing Projects
Pilot Script
ADP Plan
🟨 Andrei Cherny
Strong negative correlations with all racial and minority indicators:
HISP_PCT
: –0.43 → significantMIN_PCT
: –0.47 → significantHISP18_PCT
: –0.42 → significantMIN18_PCT
: –0.47 → significant
R² values range from 0.18 to 0.22 — modest explanatory power.
Total Population 18+: correlation near zero (–0.01), not statistically significant.
🟡 Summary: Cherny underperformed in diverse precincts (especially Hispanic and minority-heavy areas). His support was concentrated in whiter precincts, with no meaningful pattern related to precinct size.
🟥 Amish Shah
Strong positive correlations with:
HISP_PCT
: +0.48MIN_PCT
: +0.44HISP18_PCT
: +0.48MIN18_PCT
: +0.44
All statistically significant (p < 0.001).
Total Population 18+: mild negative correlation (–0.09) — not statistically meaningful.
R² values around 0.20–0.23
🟥 Summary: Shah was the strongest performer in diverse, minority, and Hispanic precincts. His support dropped slightly in more populous (denser) precincts, but not in a meaningful way. Clear demographic alignment with racially diverse communities.
🟧 Andrew Horne
No significant correlation with race or ethnicity:
Correlations: all near zero or slightly negative (–0.06 to –0.13), not significant.
Only notable pattern:
Total Population 18+
: +0.22 correlation, positive regression coefficientR² = 0.05 → weak, but statistically significant
🟧 Summary: Horne’s vote share was not strongly tied to race or ethnicity, but he did slightly better in more populated precincts — possibly reflecting strength in moderate, suburban areas with higher turnout.
🟦 Conor O’Callaghan
Moderate negative correlations with racial diversity:
HISP_PCT
: –0.43MIN_PCT
: –0.41HISP18_PCT
: –0.42MIN18_PCT
: –0.41All statistically significant
Total Population 18+: near-zero correlation (–0.03), not significant
🟦 Summary: Conor performed more strongly in precincts with lower racial diversity — not as strongly correlated as Cherny, but still inverse to diversity. No clear link to precinct size.
Marlene Woods
Very weak correlations with all demographics:
Ranged from –0.04 to –0.15
None particularly strong or meaningful
R² values low (< 0.03), even if some are statistically significant due to large sample
Mild inverse correlation with
MIN_PCT
andHISP18_PCT
Summary: Marlene’s support was not closely tied to any one demographic group. She had slight underperformance in more diverse precincts, but overall her appeal seemed broad-based and demographically neutral.
A | B | C | |
---|---|---|---|
1 | Candidate | Stronger in… | Weaker in… |
2 | Shah | Hispanic, minority, diverse areas | Slight drop in large precincts |
3 | Cherny | Whiter, less diverse precincts | Hispanic and minority areas |
4 | O’Callaghan | Whiter precincts | Diverse communities |
5 | Horne | More populous precincts | No demographic trend on race |
6 | Woods | Very neutral; broad distribution | Slightly weaker in minority areas |
Precinct | 1st Place Name | 1st Place Party | 1st Place Votes | 2nd Place Name | 2nd Place Party | 2nd Place Votes | 3rd Place Name | 3rd Place Party | 3rd Place Votes | 4th Place Name | 4th Place Party | 4th Place Votes | Top 2 Different Party | Percentage Difference (2nd vs 3rd) |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0019 AMBER | GRESS, MATT | REP | 661 | BUTLER, KELLI | DEM | 657 | GRESHAM, KAREN | DEM | 648 | CARTER, PAMELA | REP | 563 | X | 0.69% |
0021 ANDORA | BUTLER, KELLI | DEM | 997 | GRESHAM, KAREN | DEM | 910 | GRESS, MATT | REP | 888 | CARTER, PAMELA | REP | 849 | 1.22% | |
0023 ANNETTE | GRESS, MATT | REP | 1383 | CARTER, PAMELA | REP | 1249 | BUTLER, KELLI | DEM | 1126 | GRESHAM, KAREN | DEM | 1121 | 5.18% | |
0039 ASTER | GRESS, MATT | REP | 1056 | CARTER, PAMELA | REP | 1001 | BUTLER, KELLI | DEM | 768 | GRESHAM, KAREN | DEM | 730 | 13.17% | |
0043 AVIANO | GRESS, MATT | REP | 1853 | CARTER, PAMELA | REP | 1737 | BUTLER, KELLI | DEM | 1666 | GRESHAM, KAREN | DEM | 1577 | 2.09% | |
0057 BETHANY | BUTLER, KELLI | DEM | 718 | GRESHAM, KAREN | DEM | 712 | GRESS, MATT | REP | 699 | CARTER, PAMELA | REP | 593 | 0.92% | |
0060 BILTMORE | BUTLER, KELLI | DEM | 1128 | GRESS, MATT | REP | 1090 | GRESHAM, KAREN | DEM | 1051 | CARTER, PAMELA | REP | 922 | X | 1.82% |
0092 CALAVEROS | BUTLER, KELLI | DEM | 753 | GRESHAM, KAREN | DEM | 721 | GRESS, MATT | REP | 575 | CARTER, PAMELA | REP | 529 | 11.27% | |
0122 CHAPARRAL | GRESHAM, KAREN | DEM | 975 | BUTLER, KELLI | DEM | 972 | GRESS, MATT | REP | 940 | CARTER, PAMELA | REP | 844 | 1.67% | |
0125 CHENEY | GRESS, MATT | REP | 1833 | CARTER, PAMELA | REP | 1666 | BUTLER, KELLI | DEM | 954 | GRESHAM, KAREN | DEM | 920 | 27.18% | |
0136 CLEARVIEW | GRESS, MATT | REP | 1437 | CARTER, PAMELA | REP | 1383 | BUTLER, KELLI | DEM | 1354 | GRESHAM, KAREN | DEM | 1298 | 1.06% | |
0137 CLEARWATER | GRESS, MATT | REP | 649 | CARTER, PAMELA | REP | 571 | BUTLER, KELLI | DEM | 456 | GRESHAM, KAREN | DEM | 435 | 11.20% | |
0138 CLIFFVIEW | BUTLER, KELLI | DEM | 942 | GRESHAM, KAREN | DEM | 900 | GRESS, MATT | REP | 594 | CARTER, PAMELA | REP | 531 | 20.48% | |
0144 COCOPAH | GRESS, MATT | REP | 897 | CARTER, PAMELA | REP | 844 | BUTLER, KELLI | DEM | 624 | GRESHAM, KAREN | DEM | 597 | 14.99% | |
0158 COPPER | GRESS, MATT | REP | 1460 | CARTER, PAMELA | REP | 1276 | GRESHAM, KAREN | DEM | 1266 | BUTLER, KELLI | DEM | 1261 | 0.39% | |
0159 COPPER HILLS | GRESS, MATT | REP | 1215 | BUTLER, KELLI | DEM | 1077 | CARTER, PAMELA | REP | 1073 | GRESHAM, KAREN | DEM | 1037 | X | 0.19% |
0202 DEERVIEW | GRESS, MATT | REP | 444 | CARTER, PAMELA | REP | 406 | GRESHAM, KAREN | DEM | 368 | BUTLER, KELLI | DEM | 360 | 4.91% | |
0203 DEL JOYA | GRESS, MATT | REP | 1649 | CARTER, PAMELA | REP | 1605 | BUTLER, KELLI | DEM | 1296 | GRESHAM, KAREN | DEM | 1230 | 10.65% | |
0232 DOUBLETREE | GRESS, MATT | REP | 1531 | CARTER, PAMELA | REP | 1389 | BUTLER, KELLI | DEM | 921 | GRESHAM, KAREN | DEM | 890 | 20.26% | |
0238 DREYFUS | GRESS, MATT | REP | 1135 | CARTER, PAMELA | REP | 1030 | BUTLER, KELLI | DEM | 997 | GRESHAM, KAREN | DEM | 997 | 1.63% | |
0273 EVANS | GRESS, MATT | REP | 661 | BUTLER, KELLI | DEM | 597 | CARTER, PAMELA | REP | 589 | GRESHAM, KAREN | DEM | 577 | X | 0.67% |
0275 EXETER | GRESS, MATT | REP | 740 | CARTER, PAMELA | REP | 649 | BUTLER, KELLI | DEM | 595 | GRESHAM, KAREN | DEM | 550 | 4.34% | |
0292 FOXWOOD | BUTLER, KELLI | DEM | 796 | GRESS, MATT | REP | 773 | CARTER, PAMELA | REP | 737 | GRESHAM, KAREN | DEM | 733 | X | 2.38% |
0308 GEORGIA | BUTLER, KELLI | DEM | 442 | GRESHAM, KAREN | DEM | 428 | GRESS, MATT | REP | 275 | CARTER, PAMELA | REP | 238 | 21.76% | |
0322 GOLD DUST | BUTLER, KELLI | DEM | 690 | GRESS, MATT | REP | 652 | GRESHAM, KAREN | DEM | 636 | CARTER, PAMELA | REP | 599 | X | 1.24% |
0337 GREENWAY | GRESS, MATT | REP | 1386 | BUTLER, KELLI | DEM | 1370 | CARTER, PAMELA | REP | 1309 | GRESHAM, KAREN | DEM | 1299 | X | 2.28% |
0366 HIBISCUS | GRESHAM, KAREN | DEM | 464 | BUTLER, KELLI | DEM | 462 | GRESS, MATT | REP | 308 | CARTER, PAMELA | REP | 248 | 20.00% | |
0372 HILLERY | GRESS, MATT | REP | 1185 | CARTER, PAMELA | REP | 1056 | BUTLER, KELLI | DEM | 845 | GRESHAM, KAREN | DEM | 824 | 11.10% | |
0373 HILLVIEW | GRESS, MATT | REP | 1503 | CARTER, PAMELA | REP | 1434 | BUTLER, KELLI | DEM | 1169 | GRESHAM, KAREN | DEM | 1134 | 10.18% | |
0385 HOPI | GRESS, MATT | REP | 1413 | CARTER, PAMELA | REP | 1218 | BUTLER, KELLI | DEM | 942 | GRESHAM, KAREN | DEM | 902 | 12.78% | |
0386 HORIZON | GRESS, MATT | REP | 2593 | CARTER, PAMELA | REP | 2309 | BUTLER, KELLI | DEM | 1811 | GRESHAM, KAREN | DEM | 1782 | 12.09% | |
0393 INDIAN BEND | BUTLER, KELLI | DEM | 1070 | GRESHAM, KAREN | DEM | 1042 | GRESS, MATT | REP | 1039 | CARTER, PAMELA | REP | 902 | 0.14% | |
0399 JACKRABBIT | GRESS, MATT | REP | 1526 | CARTER, PAMELA | REP | 1378 | BUTLER, KELLI | DEM | 1264 | GRESHAM, KAREN | DEM | 1260 | 4.31% | |
0400 JANICE | BUTLER, KELLI | DEM | 905 | GRESS, MATT | REP | 870 | CARTER, PAMELA | REP | 847 | GRESHAM, KAREN | DEM | 827 | X | 1.34% |
0413 JUSTINE | GRESS, MATT | REP | 1307 | CARTER, PAMELA | REP | 1247 | BUTLER, KELLI | DEM | 1032 | GRESHAM, KAREN | DEM | 988 | 9.43% | |
0414 KACHINA | BUTLER, KELLI | DEM | 1523 | GRESHAM, KAREN | DEM | 1430 | GRESS, MATT | REP | 1117 | CARTER, PAMELA | REP | 996 | 12.29% | |
0421 KIVA | GRESS, MATT | REP | 649 | CARTER, PAMELA | REP | 579 | BUTLER, KELLI | DEM | 370 | GRESHAM, KAREN | DEM | 358 | 22.02% | |
0435 LARKSPUR | BUTLER, KELLI | DEM | 433 | GRESHAM, KAREN | DEM | 420 | GRESS, MATT | REP | 369 | CARTER, PAMELA | REP | 319 | 6.46% | |
0453 LIONS | GRESS, MATT | REP | 417 | CARTER, PAMELA | REP | 369 | BUTLER, KELLI | DEM | 344 | GRESHAM, KAREN | DEM | 325 | 3.51% | |
0467 LOOKOUT RIDGE | GRESS, MATT | REP | 1224 | BUTLER, KELLI | DEM | 1220 | GRESHAM, KAREN | DEM | 1125 | CARTER, PAMELA | REP | 1114 | X | 4.05% |
0477 MADISON | BUTLER, KELLI | DEM | 543 | GRESHAM, KAREN | DEM | 490 | GRESS, MATT | REP | 288 | CARTER, PAMELA | REP | 250 | 25.96% | |
0478 MADISON HEIGHTS | BUTLER, KELLI | DEM | 921 | GRESHAM, KAREN | DEM | 889 | GRESS, MATT | REP | 779 | CARTER, PAMELA | REP | 718 | 6.59% | |
0501 MCCORMICK RANCH | GRESS, MATT | REP | 2574 | CARTER, PAMELA | REP | 2440 | BUTLER, KELLI | DEM | 2347 | GRESHAM, KAREN | DEM | 2270 | 1.94% | |
0502 MCDONALD | GRESS, MATT | REP | 405 | GRESHAM, KAREN | DEM | 372 | BUTLER, KELLI | DEM | 371 | CARTER, PAMELA | REP | 355 | X | 0.13% |
0525 MOHAVE | GRESS, MATT | REP | 1408 | GRESHAM, KAREN | DEM | 1386 | BUTLER, KELLI | DEM | 1374 | CARTER, PAMELA | REP | 1258 | X | 0.43% |
0532 MONTEROSA | GRESS, MATT | REP | 582 | CARTER, PAMELA | REP | 565 | BUTLER, KELLI | DEM | 440 | GRESHAM, KAREN | DEM | 404 | 12.44% | |
0541 MUMMY MOUNTAIN | BUTLER, KELLI | DEM | 1582 | GRESHAM, KAREN | DEM | 1497 | GRESS, MATT | REP | 1423 | CARTER, PAMELA | REP | 1311 | 2.53% | |
0543 MUSTANG | GRESS, MATT | REP | 1921 | CARTER, PAMELA | REP | 1855 | BUTLER, KELLI | DEM | 1545 | GRESHAM, KAREN | DEM | 1465 | 9.12% | |
0580 OAKHURST | GRESS, MATT | REP | 499 | CARTER, PAMELA | REP | 460 | BUTLER, KELLI | DEM | 378 | GRESHAM, KAREN | DEM | 353 | 9.79% | |
0588 ONYX | BUTLER, KELLI | DEM | 800 | GRESHAM, KAREN | DEM | 800 | GRESS, MATT | REP | 679 | CARTER, PAMELA | REP | 595 | 8.18% | |
0590 ORANGE TREE | GRESS, MATT | REP | 649 | CARTER, PAMELA | REP | 596 | BUTLER, KELLI | DEM | 432 | GRESHAM, KAREN | DEM | 392 | 15.95% | |
0611 PALO CRISTI | GRESS, MATT | REP | 1254 | CARTER, PAMELA | REP | 1146 | BUTLER, KELLI | DEM | 797 | GRESHAM, KAREN | DEM | 707 | 17.96% | |
0619 PARK MEADOWS | GRESS, MATT | REP | 683 | CARTER, PAMELA | REP | 624 | BUTLER, KELLI | DEM | 436 | GRESHAM, KAREN | DEM | 430 | 17.74% | |
0641 PILLAR | GRESS, MATT | REP | 1434 | CARTER, PAMELA | REP | 1360 | BUTLER, KELLI | DEM | 1151 | GRESHAM, KAREN | DEM | 1069 | 8.32% | |
0643 PINE VALLEY | GRESS, MATT | REP | 1972 | CARTER, PAMELA | REP | 1781 | BUTLER, KELLI | DEM | 1280 | GRESHAM, KAREN | DEM | 1261 | 16.37% | |
0662 PRINCESS | GRESS, MATT | REP | 1240 | CARTER, PAMELA | REP | 1114 | GRESHAM, KAREN | DEM | 737 | BUTLER, KELLI | DEM | 722 | 20.37% | |
0671 RAINTREE | GRESS, MATT | REP | 1025 | BUTLER, KELLI | DEM | 1017 | GRESHAM, KAREN | DEM | 969 | CARTER, PAMELA | REP | 951 | X | 2.42% |
0679 REDWING | GRESHAM, KAREN | DEM | 1339 | BUTLER, KELLI | DEM | 1319 | GRESS, MATT | REP | 1166 | CARTER, PAMELA | REP | 1027 | 6.16% | |
0727 SAN SIMON | GRESS, MATT | REP | 613 | BUTLER, KELLI | DEM | 599 | GRESHAM, KAREN | DEM | 573 | CARTER, PAMELA | REP | 560 | X | 2.22% |
0728 SAN VICTOR | GRESS, MATT | REP | 1039 | BUTLER, KELLI | DEM | 996 | GRESHAM, KAREN | DEM | 994 | CARTER, PAMELA | REP | 958 | X | 0.10% |
0730 SANDPIPER | GRESS, MATT | REP | 1261 | CARTER, PAMELA | REP | 1205 | BUTLER, KELLI | DEM | 860 | GRESHAM, KAREN | DEM | 823 | 16.71% | |
0734 SANTO | GRESS, MATT | REP | 1343 | CARTER, PAMELA | REP | 1313 | BUTLER, KELLI | DEM | 1102 | GRESHAM, KAREN | DEM | 1041 | 8.74% | |
0742 SENTRY | GRESHAM, KAREN | DEM | 846 | BUTLER, KELLI | DEM | 843 | GRESS, MATT | REP | 808 | CARTER, PAMELA | REP | 746 | 2.12% | |
0745 SHADOW ROCK | BUTLER, KELLI | DEM | 1154 | GRESS, MATT | REP | 1073 | GRESHAM, KAREN | DEM | 1036 | CARTER, PAMELA | REP | 984 | X | 1.75% |
0755 SIERRA PASS | GRESS, MATT | REP | 2165 | BUTLER, KELLI | DEM | 1957 | CARTER, PAMELA | REP | 1923 | GRESHAM, KAREN | DEM | 1922 | X | 0.88% |
0807 SUNDOWN | GRESS, MATT | REP | 1149 | CARTER, PAMELA | REP | 1022 | BUTLER, KELLI | DEM | 908 | GRESHAM, KAREN | DEM | 880 | 5.91% | |
0812 SUNNYSIDE | GRESS, MATT | REP | 554 | CARTER, PAMELA | REP | 553 | BUTLER, KELLI | DEM | 430 | GRESHAM, KAREN | DEM | 428 | 12.51% | |
0828 TATUM | GRESS, MATT | REP | 1961 | CARTER, PAMELA | REP | 1714 | GRESHAM, KAREN | DEM | 1533 | BUTLER, KELLI | DEM | 1532 | 5.57% | |
0841 TOPEKA | GRESS, MATT | REP | 803 | BUTLER, KELLI | DEM | 765 | GRESHAM, KAREN | DEM | 754 | CARTER, PAMELA | REP | 698 | X | 0.72% |
0874 VILLA RITA | GRESS, MATT | REP | 923 | BUTLER, KELLI | DEM | 899 | GRESHAM, KAREN | DEM | 891 | CARTER, PAMELA | REP | 797 | X | 0.45% |
List of precincts where the top vote-getter for the Senate and the House were from different parties: | ||||||||||||||
Precinct | Senate Winner Party | HOUSE WINNER PARTY | ||||||||||||
0019 AMBER | Democrat | REPUBLICAN | ||||||||||||
0337 GREENWAY | Democrat | REPUBLICAN | ||||||||||||
0467 LOOKOUT RIDGE | Democrat | REPUBLICAN | ||||||||||||
0502 MCDONALD | Democrat | REPUBLICAN | ||||||||||||
0525 MOHAVE | Democrat | REPUBLICAN | ||||||||||||
0671 RAINTREE | Democrat | REPUBLICAN | ||||||||||||
0727 SAN SIMON | Democrat | REPUBLICAN | ||||||||||||
0728 SAN VICTOR | Democrat | REPUBLICAN | ||||||||||||
0841 TOPEKA | Democrat | REPUBLICAN | ||||||||||||
0874 VILLA RITA | Democrat | REPUBLICAN | ||||||||||||
There are no precincts where a Republican won the Senate race and a Democrat won the House race in LD4. |
Every Election within Congressional District One
Every Election within Legislative District Four 2024 General
Every Election with Overlap LD5 and CD1 2004 General
Every Election with a One to One Matchup
Instructions
🔹 Step 1: Identify CD-1 Precincts
From the "Maricopa County Precinct Number"
sheet:
Filter rows where
US Rep Dist CD = 1
.Extract the list of
Precinct ExtId
values — this is your official list of CD-1 precincts.
🔹 Step 2: Filter Vote Results to CD-1
Using the "Without BondsMeasures"
sheet:
Keep only rows where
Precinct ExtId
matches the CD-1 list.This ensures you're only analyzing votes cast within CD-1, regardless of contest boundaries.
🔹 Step 3: Tally Contest Results (CD-1 Votes Only)
For each contest:
Aggregate vote totals by
ContestName
andCandidate Name
.Calculate vote percentage for each candidate within their contest.
Use the
"Possible Winners"
sheet to determine how many winners each contest allows.Rank candidates by votes.
Mark top N candidates as winners, where N = Possible Winners.
For multi-winner contests:
Compare each winner to the top-losing candidate (i.e., highest-ranked non-winner).
This shows the narrowest margin that still secured a win.
🔹 Step 4: Compute Contest Outcome Metrics
For each winner vs. top-loser matchup:
Winner percentage
= % of total CD-1 votes for winnerLoser percentage
= % of total CD-1 votes for top-losing candidateMargin of Victory (%)
= Winner % – Loser %Vote differential
= Winner votes – Loser votes
Do not rely on any pre-labeled "winner"/"loser" flags in the raw data.
🔹 Step 5: Sort Contests by Ballot Order
Use the "Candidate Order"
sheet to sort final results by Contest Name
, in official ballot order.
🔹 Step 6: Prepare Final Excel Output
📄 Sheet: “CD-1”
Each row = one winner compared to the top-losing candidate in that contest.📄 Additional Sheets: “LD2”, “LD3”, “LD4”, etc.
Follow the same steps above, using the corresponding list of precincts for each LD.
📊 Required Columns in Final Output
ColumnDescriptionContest Name
Full name of the contestWinner name
Candidate who won (compare even if multiple winners)Loser name
Top-losing candidate (highest non-winner)Winner percentage
% of CD-1 votes received by winnerLoser percentage
% of CD-1 votes received by loserMargin of Victory (%)
Difference between winner and loser percentageVote differential
Winner votes – Loser votes (raw total)
🟢 Multi-Winner Example:
Contest: State Rep Dist-4
Possible Winners: 2
Top 3 vote-getters:
Alice — 33.2% ✅
Bob — 32.1% ✅
Carlos — 31.7% ❌
Compare:
Alice → Carlos
Bob → Carlos
→ Margin = 0.4%
→ Vote Differential = Bob votes – Carlos votes
Do all of the steps and complete them without asking for each step.