Package {eiballots}


Title: Ballot-Level Microdata and Summaries for Ecological Inference (Florida 2000)
Version: 0.2.0-1
Description: Provides access to ballot-level electoral microdata from the Florida 2000 general election and tools for computing summaries suitable for ecological inference. Includes functions to load data by county or race (election), compute marginal distributions at the precinct level, and build joint contingency arrays across multiple races for use with ecological inference packages. Data files are stored in a remote repository and downloaded on demand; local copies are supported via the 'data_dir' option. Acknowledgements: We thank Jaime Ventura (ANES, University of Michigan) and Dan Keating (The Washington Post) for providing the raw data that serve as the starting point for the construction of this package. We also acknowledge funding from the Conselleria de Educación, Cultura y Universidades (grant CIACIO/2023/031).
URL: https://doi.org/10.17605/OSF.IO/NP73B
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.2
LazyData: true
Depends: R (≥ 4.1.0)
Imports: stats
Suggests: testthat (≥ 3.0.0), usethis
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-10-12 11:51:46 UTC; pavia
Author: Cristina Aybar ORCID iD [aut], Jose M. Pavía ORCID iD [aut, cre]
Maintainer: Jose M. Pavía <jose.m.pavia@uv.es>
Repository: CRAN
Date/Publication: 2026-10-12 15:00:02 UTC

Broward County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Broward County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Broward

Format

A county metadata object. The underlying microdata has 588,007 rows (one per voter) across 747 precincts and 61 columns:

COUNTY

County identifier ("Broward").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR19

United States Representative Congressional District 19. Observed options: D, R, A, I.

USR20

United States Representative Congressional District 20. Observed options: D, O, A, I.

USR22

United States Representative Congressional District 22. Observed options: D, O, R, A, I.

USR23

United States Representative Congressional District 23. Observed options: D, O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

STS31

State Senator - Senatorial District 31. Observed options: D, R, A, I.

STS32

State Senator - Senatorial District 32. Observed options: D, R, A, I.

SRH91

State Representative - House District 91. Observed options: D, R, A, I.

SRH92

State Representative - House District 92. Observed options: D, R, A, I.

SRH96

State Representative - House District 96. Observed options: D, R, A, I.

SRH97

State Representative - House District 97. Observed options: D, R, A, I.

SRH98

State Representative - House District 98. Observed options: D, R, A, I.

SRH100

State Representative - House District 100. Observed options: D, R, A, I.

CCC1

Clerk of the Circuit Court. Observed options: D, R, A, I.

PAP1

Property appraiser. Observed options: D, R, A, I.

SUP1

Supervisor of elections. Observed options: D, R, A, I.

COC3BRO

County Commissioner District 3. Observed options: D, O, R, A, I.

COC7BRO

County Commissioner District 7. Observed options: D, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D41

Shall Judge John W. Dell of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D42

Shall Judge Bobby W. Gunther of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D43

Shall Judge Fred A. Hazouri of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D44

Shall Judge Larry A. Klein of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D45

Shall Judge Barry J. Stone of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D46

Shall Judge Carole Y. Taylor of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

CICJ31

Circuit Judge Group 31. Observed options: B, F, A, I.

SCB5

Member School Board District 5. Observed options: WBa, WBe, A, I.

WCD

Central Broward Water Control District. Observed options: B, L, A, I.

CDD

Community Development District. Supervisor. Multi-member race (vote for 2); candidates: Bourdin, Horn, Shore, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. B). Observed options: B, BH, BS, H, HS, S, A, I.

PAID

Plantation Acres Improvement District. Supervisor. Multi-member race (vote for 2); candidates: Davis, Hawkins, Petti, Uria, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. D). Observed options: D, DH, DP, DU, H, HP, HU, P, PU, U, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

BONRE1

Bond Referendum. Options: N, Y, A, I.

BRORE1

Increasing number of commissioners needed to call a special meeting of the county commission. Options: N, Y, A, I.

BRORE2

Increasing number of commissioners votes needed to propose amendments to the charter. Options: N, Y, A, I.

ANNA

Annexation of Unincorporated Area Described as 'Area A'. Options: D, H, A.

ANNB

Annexation of Unincorporated Area Described as 'Area B'. Options: D, H, A.

ANNC

Annexation of Unincorporated Area Described as 'Area C'. Options: D, H, A.

ANND

Annexation of Unincorporated Area Described as 'Area D'. Options: D, H, A, I.

WERE1

City of Weston. Charter Amendments. Filling of Vacancies on Commission. Options: N, Y, A, I.

WERE2

City of Weston. Charter Amendments. 60-Day Filing Period for Initiative and Referendum Petitions. Options: N, Y, A, I.

WERE3

City of Weston. Charter Amendments. Signatures Required for Charter Amendment Petition. Options: N, Y, A, I.

DEERE1

Authority to lease 30% of city owned 4.6 acre parcel. Options: N, Y, A, I.

PEMRE1

City of Pembroke Park. Mobile home park zoning preservation. Options: N, Y, A, I.

WERE4

City of Weston. Charter Amendments. Commission Approval of Site Plans. Options: N, Y, A, I.

PEMRE2

City of Pembroke Park. Election of commissioners and appointment of mayor following annexation. Options: N, Y, A.

WERE5

City of Weston. Charter Amendments. Removal of Obsolete Transitional Provisions. Options: N, Y, A, I.

WERE6

City of Weston. Charter Amendments. Removal of Certain Budgetary Provisions. Options: N, Y, A, I.

WERE7

City of Weston. Charter Amendments. Technical Changes - Modernizing and Clarifying Language. Options: N, Y, A, I.

WERE8

City of Weston. Charter Amendments. Residential Area Boundaries. Options: N, Y, A, I.

WERE9

City of Weston. Charter Amendments. Interim Residence Provision. Options: N, Y, A, I.

WERE10

City of Weston. Charter Amendments. Anti-discrimination. Options: N, Y, A, I.

TAMRE1

City of Tamarac. Elimination of additional referendum requirements from the tamarac charter and requiring compliance with state law. Options: N, Y, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 588,007 747
USS 588,007 747
USR19 151,056 152
USR20 240,068 256
USR22 115,875 171
USR23 80,976 160
TRE 588,007 747
EDU 588,007 747
STS31 107,694 184
STS32 155,453 142
SRH91 36,533 47
SRH92 45,047 81
SRH96 58,494 60
SRH97 85,259 65
SRH98 57,803 68
SRH100 43,844 67
CCC1 588,007 747
PAP1 588,007 747
SUP1 588,007 747
COC3BRO 68,900 58
COC7BRO 60,669 115
SC1 588,007 747
SC2 588,007 747
SC3 588,007 747
D41 588,007 747
D42 588,007 747
D43 588,007 747
D44 588,007 747
D45 588,007 747
D46 588,007 747
CICJ31 588,007 747
SCB5 60,238 117
WCD 5,566 10
CDD 1,249 2
PAID 2,298 4
A01 588,007 747
A02 588,007 747
A03 588,007 747
BONRE1 588,007 747
BRORE1 588,007 747
BRORE2 588,007 747
ANNA 1,168 2
ANNB 1,139 2
ANNC 1,306 2
ANND 1,246 2
WERE1 17,346 9
WERE2 17,346 9
WERE3 17,346 9
DEERE1 26,433 40
PEMRE1 942 5
WERE4 17,346 9
PEMRE2 942 5
WERE5 17,346 9
WERE6 17,346 9
WERE7 17,346 9
WERE8 17,346 9
WERE9 17,346 9
WERE10 17,346 9
TAMRE1 27,008 40

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Broward


# Load the full microdata
broward_data <- get_county_data("Broward")

# Alternatively, using the county object directly
broward_data <- as.data.frame(Broward)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Broward))


Highlands County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Highlands County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Highlands

Format

A county metadata object. The underlying microdata has 22,237 rows (one per voter) across 20 precincts and 25 columns:

COUNTY

County identifier ("Highlands").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR12

United States Representative Congressional District 12. Observed options: O, R, A, I.

USR16

United States Representative Congressional District 16. Observed options: D, O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

SRH77

State Representative - House District 77. Observed options: D, R, A, I.

CCC2

Clerk of the Circuit Court. Observed options: D, R, A, I.

COC3HIG

County Commissioner District 3. Observed options: O, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D21

Shall Judge John R. Blue of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D22

Shall Judge Darryl C. Casanueva of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D23

Shall Judge Charles A. Davis, Jr. of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D24

Shall Judge Oliver L. Green of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D25

Shall Judge E. J. Salcines of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D26

Shall Judge Thomas E. Stringer of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D27

Shall Judge Edward F. Threadgill of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

LPTRE1

City of Lake Placid. Amendment charter section 404. Options: N, Y, A.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 22,237 20
USS 22,237 20
USR12 1,088 2
USR16 21,149 18
TRE 22,237 20
EDU 22,237 20
SRH77 20,538 17
CCC2 22,237 20
COC3HIG 22,237 20
SC1 22,237 20
SC2 22,237 20
SC3 22,237 20
D21 22,237 20
D22 22,237 20
D23 22,237 20
D24 22,237 20
D25 22,237 20
D26 22,237 20
D27 22,237 20
A01 22,237 20
A02 22,237 20
A03 22,237 20
LPTRE1 66 2

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Highlands


# Load the full microdata
highlands_data <- get_county_data("Highlands")

# Alternatively, using the county object directly
highlands_data <- as.data.frame(Highlands)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Highlands))


Hillsborough County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Hillsborough County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Hillsborough

Format

A county metadata object. The underlying microdata has 355,027 rows (one per voter) across 366 precincts and 54 columns:

COUNTY

County identifier ("Hillsborough").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR9

United States Representative Congressional District 9. Observed options: O, R, A, I.

USR11

United States Representative Congressional District 11. Observed options: D, O, A, I.

USR12

United States Representative Congressional District 12. Observed options: D, R, A, I.

USR13

United States Representative Congressional District 13. Observed options: D, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

STA13

State Attorney Thirteenth Judicial Circuit. Observed options: D, R, A, I.

PUB1

Public Defender Thirteenth Judicial Circuit. Observed options: D, R, A, I.

STS13

State Senator - Senatorial District 13. Observed options: D, R, A, I.

STS21

State Senator - Senatorial District 21. Observed options: D, O, R, A, I.

SRH47

State Representative - House District 47. Observed options: D, R, A, I.

SRH48

State Representative - House District 48. Observed options: O, R, A, I.

SRH56

State Representative - House District 56. Observed options: D, R, A, I.

SRH57

State Representative - House District 57. Observed options: O, R, A, I.

SRH58

State Representative - House District 58. Observed options: D, R, A, I.

SRH60

State Representative - House District 60. Observed options: D, R, A, I.

SRH61

State Representative - House District 61. Observed options: D, R, A, I.

SRH62

State Representative - House District 62. Observed options: D, R, A, I.

SRH66

State Representative - House District 66. Observed options: O, R, A, I.

CCC3

Clerk of the Circuit Court. Observed options: O, R, A, I.

SHE1

Sheriff. Observed options: O, R, A, I.

PAP2

Property appraiser. Observed options: D, R, A, I.

SUP2

Supervisor of elections. Observed options: D, R, A, I.

COC1HIL

County Commissioner District 1. Observed options: D, R, A, I.

COC3HIL

County Commissioner District 3. Observed options: D, O, A, I.

COC6HIL

County Commissioner District 6. Observed options: D, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D21

Shall Judge John R. Blue of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D22

Shall Judge Darryl C. Casanueva of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D23

Shall Judge Charles A. Davis, Jr. of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D24

Shall Judge Oliver L. Green of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D25

Shall Judge E. J. Salcines of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D26

Shall Judge Thomas E. Stringer of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D27

Shall Judge Edward F. Threadgill of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

CICJ25

Circuit Judge Group 25. Observed options: B, F, A, I.

COCJ3

County Court Judge Group 3. Observed options: Na, Ob, A, I.

SCB7HIL

Member School Board District 7. Observed options: Ku, WI, A, I.

TTE

Temple Terrace. City Council. Multi-member race (vote for 2); candidates: Chillura, Curry, Jeter, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. ChCu). Observed options: Ch, ChCu, ChJe, Cu, CuJe, Je, A, I.

STP

Supervisor, Tampa Palms Community Development District. Multi-member race (vote for 3); candidates: Cameron, Copeland, Fitzpatrick, Miller, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. CaCo). Observed options: Ca, CaCo, CaCoFi, CaCoMi, CaFi, CaFiMi, CaMi, Co, CoFi, CoFiMi, CoMi, Fi, Mi, MiFi, A, I.

SCW

Supervisor, Cheval West Community Development District. Multi-member race (vote for 3); candidates: Burley, Lencioni, Miller, Rankin, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. BuLeMi). Observed options: Bu, BuLeMi, BuLeRa, Le, LeMiRa, A.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

TAM3

City of Tampa Charter Amendments. NO. 3. Options: N, Y, A, I.

TAM1

City of Tampa Charter Amendments. NO. 1. Options: N, Y, A, I.

TAM2

City of Tampa Charter Amendments. NO. 2. Options: N, Y, A, I.

TAM4

City of Tampa Charter Amendments. NO. 4. Options: N, Y, A, I.

TAM5

City of Tampa Charter Amendments. NO. 5. Options: N, Y, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 355,027 366
USS 355,027 366
USR9 81,313 80
USR11 205,659 226
USR12 47,927 38
USR13 20,128 22
TRE 355,027 366
EDU 355,027 366
STA13 355,027 366
PUB1 355,027 366
STS13 128,276 123
STS21 62,938 99
SRH47 47,845 42
SRH48 4,776 7
SRH56 43,330 53
SRH57 50,440 32
SRH58 35,688 45
SRH60 36,286 50
SRH61 25,960 34
SRH62 50,984 35
SRH66 20,640 25
CCC3 355,027 366
SHE1 355,027 366
PAP2 355,027 366
SUP2 355,027 366
COC1HIL 85,531 82
COC3HIL 57,604 88
COC6HIL 355,027 366
SC1 355,027 366
SC2 355,027 366
SC3 355,027 366
D21 355,027 366
D22 355,027 366
D23 355,027 366
D24 355,027 366
D25 355,027 366
D26 355,027 366
D27 355,027 366
CICJ25 355,027 366
COCJ3 355,027 366
SCB7HIL 355,027 366
TTE 8,898 7
STP 4,025 4
SCW 19 1
A01 355,027 366
A02 355,027 366
A03 355,027 366
TAM3 102,904 116
TAM1 102,904 116
TAM2 102,904 116
TAM4 102,904 116
TAM5 102,904 116

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Hillsborough


# Load the full microdata
hillsborough_data <- get_county_data("Hillsborough")

# Alternatively, using the county object directly
hillsborough_data <- as.data.frame(Hillsborough)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Hillsborough))


Lee County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Lee County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Lee

Format

A county metadata object. The underlying microdata has 188,857 rows (one per voter) across 194 precincts and 37 columns:

COUNTY

County identifier ("Lee").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR14

United States Representative Congressional District 14. Observed options: O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

STS35

State Senator - Senatorial District 35. Observed options: D, O, R, A, I.

SRH72

State Representative - House District 72. Observed options: O, R, A, I.

SRH73

State Representative - House District 73. Observed options: D, R, A, I.

SRH74

State Representative - House District 74. Observed options: O, R, A, I.

SRH75

State Representative - House District 75. Observed options: O, R, A, I.

SHE2

Sheriff. Observed options: D, O, R, A, I.

TAX1

Tax Collector. Observed options: D, R, A, I.

COC1LEE

County Commissioner District 1. Observed options: O, R, A, I.

COC5LEE

County Commissioner District 5. Observed options: O, R, A, I.

HOS3

Hospital Board of Directors Lee County District 3. Multi-member race (vote for 2); candidates: Barrett, Bauchert, Berkowitz, Brown, Duff, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. BarBau). Observed options: Bar, BarBau, BarBer, BarBro, BarDuf, Bau, BauBer, BauBro, BauDuf, Ber, BerBro, BerDuf, Bro, BroDuf, Duf, A, I.

HOS5

Hospital Board of Directors Lee County District 5. Multi-member race (vote for 2); candidates: Doragh, Farabee, Green, Smith, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. DorFar). Observed options: Dor, DorFar, DorGre, DorSmi, Far, FarGre, FarSmi, Gre, GreSmi, Smi, A, I.

MOS1

Lee County Mosquito Control. Mosquito Board Area 1. Observed options: Mu, So, A, I.

MOS3

Lee County Mosquito Control. Mosquito Board Area 3. Observed options: Ga, Mc, A, I.

MOS7

Lee County Mosquito Control. Mosquito Board Area 7. Observed options: As, Sa, A, I.

SCB2

Member School Board District 2. Observed options: Do, Mo, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D21

Shall Judge John R. Blue of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D22

Shall Judge Darryl C. Casanueva of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D23

Shall Judge Charles A. Davis, Jr. of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D24

Shall Judge Oliver L. Green of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D25

Shall Judge E. J. Salcines of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D26

Shall Judge Thomas E. Stringer of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D27

Shall Judge Edward F. Threadgill of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

CCR

County Charter Revisions to Adoption of County Ordinances by Citizen Initiative. Options: N, Y, A, I.

FMSRE

Fort Myers Shores Referendum. Options: N, Y, A.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 188,857 194
USS 188,857 194
USR14 188,857 194
TRE 188,857 194
EDU 188,857 194
STS35 41,349 57
SRH72 17,522 24
SRH73 40,545 52
SRH74 57,595 52
SRH75 73,195 66
SHE2 188,857 194
TAX1 188,857 194
COC1LEE 188,857 194
COC5LEE 188,857 194
HOS3 188,857 194
HOS5 188,857 194
MOS1 188,857 194
MOS3 188,857 194
MOS7 188,857 194
SCB2 188,857 194
SC1 188,857 194
SC2 188,857 194
SC3 188,857 194
D21 188,857 194
D22 188,857 194
D23 188,857 194
D24 188,857 194
D25 188,857 194
D26 188,857 194
D27 188,857 194
A01 188,857 194
A02 188,857 194
A03 188,857 194
CCR 188,857 194
FMSRE 2,910 6

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Lee


# Load the full microdata
lee_data <- get_county_data("Lee")

# Alternatively, using the county object directly
lee_data <- as.data.frame(Lee)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Lee))


Marion County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Marion County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Marion

Format

A county metadata object. The underlying microdata has 105,185 rows (one per voter) across 115 precincts and 30 columns:

COUNTY

County identifier ("Marion").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR5

United States Representative Congressional District 5. Observed options: D, O, R, A, I.

USR6

United States Representative Congressional District 6. Observed options: O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

STS5

State Senator - Senatorial District 5. Observed options: D, R, A, I.

STS11

State Senator - Senatorial District 11. Observed options: D, R, A, I.

SRH10

State Representative - House District 10. Observed options: D, R, A, I.

SRH21

State Representative - House District 21. Observed options: D, R, A, I.

SRH22

State Representative - House District 22. Observed options: D, O, R, A, I.

SRH23

State Representative - House District 23. Observed options: D, O, A, I.

SRH24

State Representative - House District 24. Observed options: D, R, A, I.

SRH25

State Representative - House District 25. Observed options: D, R, A, I.

SRH42

State Representative - House District 42. Observed options: D, O, R, A, I.

SHE3

Sheriff. Observed options: D, R, A, I.

SSC

Superintendent of Schools. Observed options: D, R, A, I.

COC1MRN

County Commissioner District 1. Observed options: D, R, A, I.

COC3MRN

County Commissioner District 3. Observed options: D, R, A, I.

COC5MRN

County Commissioner District 5. Observed options: D, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D51

Shall Judge Emerson R. Thompson, Jr. of the 5TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

SSS

Silver Springs Shores Tax District, Advisory Council. Multi-member race (vote for 3); candidates: Calkins, Cimjotti, Hodges, Popejoy, Scott, Walker, Warburton, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. CalCimHod). Observed options: Cal, CalCimHod, CalCimPop, CalCimSco, CalCimWal, CalCimWar, CalHodPop, CalHodSco, CalHodWal, CalHodWar, CalPopSco, CalPopWal, CalPopWar, CalScoWal, CalWalWar, Cim, CimHodPop, CimHodSco, CimPopSco, CimPopWal, CimPopWar, CimScoWal, CimScoWar, CimWalWar, Hod, HodPopSco, HodPopWal, HodPopWar, HodScoWal, HodScoWar, HodWalWar, Pop, PopScoWal, PopScoWar, PopWalWar, Sco, ScoWalWar, Wal, War, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 105,185 115
USS 105,185 115
USR5 7,802 10
USR6 97,383 105
TRE 105,185 115
EDU 105,185 115
STS5 10,535 18
STS11 57,273 53
SRH10 5,319 6
SRH21 5,825 11
SRH22 9,314 15
SRH23 6,145 14
SRH24 62,340 54
SRH25 1,789 4
SRH42 13,471 15
SHE3 105,185 115
SSC 105,185 115
COC1MRN 105,185 115
COC3MRN 105,185 115
COC5MRN 105,185 115
SC1 105,185 115
SC2 105,185 115
SC3 105,185 115
D51 105,185 115
A01 105,185 115
A02 105,185 115
A03 105,185 115
SSS 4,103 4

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Marion


# Load the full microdata
marion_data <- get_county_data("Marion")

# Alternatively, using the county object directly
marion_data <- as.data.frame(Marion)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Marion))


Miami-Dade County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Miami-Dade County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Miami_Dade

Format

A county metadata object. The underlying microdata has 651,650 rows (one per voter) across 762 precincts and 55 columns:

COUNTY

County identifier ("Miami_Dade").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR17

United States Representative Congressional District 17. Observed options: D, A.

USR18

United States Representative Congressional District 18. Observed options: R, A.

USR20

United States Representative Congressional District 20. Observed options: D, A.

USR21

United States Representative Congressional District 21. Observed options: R, A.

USR22

United States Representative Congressional District 22. Observed options: D, R, A, I.

USR23

United States Representative Congressional District 23. Observed options: D, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

STA11

State Attorney Eleventh Judicial. Observed options: D, R, A, I.

STS39

State Senator - Senatorial District 39. Observed options: R, A.

STS32

State Senator - Senatorial District 32. Observed options: D, R, A, I.

SRH106

State Representative - House District 106. Observed options: D, O, A, I.

SRH108

State Representative - House District 108. Observed options: D, O, R, A, I.

SRH116

State Representative - House District 116. Observed options: D, R, A, I.

SRH119

State Representative - House District 119. Observed options: D, R, A, I.

SRH120

State Representative - House District 120. Observed options: D, R, A, I.

SRH109

State Representative - House District 109. Observed options: D, A.

SRH115

State Representative - House District 115. Observed options: R, A.

SRH117

State Representative - House District 117. Observed options: R, A.

SRH118

State Representative - House District 118. Observed options: D, A.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D31

Shall Judge James R. Jorgenson of the 3RD DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

CICJ8

Circuit Judge Group 8. Observed options: M, P, A, I.

CICJ4

Circuit Judge, Eleventh Circuit, Group 25. Observed options: Me, Mu, A, I.

COCJ4

County Court Judge Group 4. Observed options: H, Ri, A, I.

SCB7MD

Member School Board District 7. Observed options: Pp, Pr, A, I.

NBMY

City of North Bay. Mayor. Observed options: Di, Do, A, I.

OLMY

City of Opa Locka. Mayor. Observed options: H, M, A, I.

KBMY

City of Key Biscayne. Mayor. Observed options: P, Ra, A, I.

NBALC

City of North Bay. At Large Commissioner. Observed options: L, S, A, I.

OLC

City of Opa Locka. Commissioner. Multi-member race (vote for 2); candidates: Barrett, Cobbs, Kelley, Tydus, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. B). Observed options: B, BC, BK, BT, C, CK, CT, K, KT, T, A, I.

NBC3

City of North Bay (Harbor Island). Commissioner. Observed options: Ka, Os, Te, A, I.

KBCO

City of Key Biscayne. Village Council. Multi-member race (vote for 2); candidates: Broucek, Fried, Garcia, Guillen, Abstention, Invalid vote. Each observed combination is an atomic category (e.g. BrFr). Observed options: Br, BrFr, BrGa, BrGu, Fr, FrGa, FrGu, Ga, GaGu, Gu, A, I.

NBC1

City of North Bay. Commissioner. Observed options: Du, Is, A, I.

NBC2

City of North Bay (Treasure Island). Commissioner. Observed options: Ab, S, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

DADRE1

Limited Public Financing for Candidates. Options: N, Y, A, I.

DADRE2

Improve Fire and Rescue Service. Options: N, Y, A, I.

HIRE1

Non-binding straw ballot question. Hialeah Special Election. Options: N, Y, A, I.

NMRE1

City of North Miami. Amendment building height. Options: N, Y, A, I.

MIARE1

City of Miami. Amendment assets transfer. Options: N, Y, A, I.

NMRE2

City of North Miami. Amendment poll watchers. Options: N, Y, A, I.

MBRE1

Miami Beach. Lease of Park Land. Options: N, Y, A, I.

NBRE1

City of North Bay Village. Amendment general revisions. Options: N, Y, A.

MIARE2

City of Miami. Amendment board composition. Options: N, Y, A, I.

NBRE2

City of North Bay Village. Amendment election date. Options: N, Y, A, I.

NBRE3

City of North Bay Village. Amendment term limits. Options: N, Y, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 651,650 762
USS 651,650 762
USR17 156,855 222
USR18 186,421 213
USR20 26,337 42
USR21 210,131 180
USR22 64,412 79
USR23 6,783 8
TRE 651,650 762
EDU 651,650 762
STA11 651,650 762
STS39 118,955 120
STS32 25,721 25
SRH106 41,507 48
SRH108 29,470 41
SRH116 38,954 39
SRH119 34,706 50
SRH120 5,779 14
SRH109 29,622 49
SRH115 41,029 54
SRH117 38,895 39
SRH118 42,047 62
SC1 651,650 762
SC2 651,650 762
SC3 651,650 762
D31 651,650 762
CICJ8 651,650 762
CICJ4 651,650 762
COCJ4 651,650 762
SCB7MD 97,371 98
NBMY 1,666 3
OLMY 3,470 7
KBMY 3,847 4
NBALC 1,666 3
OLC 3,470 7
NBC3 1,666 3
KBCO 3,847 4
NBC1 1,666 3
NBC2 1,666 3
A01 651,650 762
A02 651,650 762
A03 651,650 762
DADRE1 651,650 762
DADRE2 17,130 24
HIRE1 54,379 45
NMRE1 14,811 19
MIARE1 94,881 125
NMRE2 14,811 19
MBRE1 7,465 9
NBRE1 1,666 3
MIARE2 94,881 125
NBRE2 1,666 3
NBRE3 1,666 3

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Miami_Dade


# Load the full microdata
miami_dade_data <- get_county_data("Miami_Dade")

# Alternatively, using the county object directly
miami_dade_data <- as.data.frame(Miami_Dade)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Miami_Dade))


Palm Beach County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Palm Beach County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Palm_Beach

Format

A county metadata object. The underlying microdata has 447,466 rows (one per voter) across 592 precincts and 45 columns:

COUNTY

County identifier ("Palm_Beach").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR16

United States Representative Congressional District 16. Observed options: D, O, R, A, I.

USR19

United States Representative Congressional District 19. Observed options: D, O, R, A, I.

USR22

United States Representative Congressional District 22. Observed options: D, O, R, A, I.

USR23

United States Representative Congressional District 23. Observed options: D, O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

PUB2

Public Defender Fifteenth Judicial Circuit. Observed options: D, R, A, I.

STS27

State Senator - Senatorial District 27. Observed options: O, R, A, I.

STS31

State Senator - Senatorial District 31. Observed options: D, R, A, I.

STS35

State Senator - Senatorial District 35. Observed options: D, O, R, A, I.

SRH82

State Representative - House District 82. Observed options: O, R, A.

SRH83

State Representative - House District 83. Observed options: D, O, R, A, I.

SRH84

State Representative - House District 84. Observed options: D, O, R, A, I.

SRH85

State Representative - House District 85. Observed options: D, R, A, I.

SRH87

State Representative - House District 87. Observed options: D, R, A, I.

SRH88

State Representative - House District 88. Observed options: D, O, A, I.

SRH89

State Representative - House District 89. Observed options: D, O, A, I.

SRH91

State Representative - House District 91. Observed options: D, R, A, I.

CCC4

Clerk of the Circuit Court. Observed options: D, R, A, I.

SHE5

Sheriff. Observed options: D, R, A, I.

TAX2

Tax Collector. Observed options: D, R, A, I.

PPB1

Port of Palm Beach. Group 1. Observed options: D, R, A, I.

PPB3

Port of Palm Beach. Group 3. Observed options: D, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D41

Shall Judge John W. Dell of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D42

Shall Judge Bobby W. Gunther of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D43

Shall Judge Fred A. Hazouri of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D44

Shall Judge Larry A. Klein of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D45

Shall Judge Barry J. Stone of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D46

Shall Judge Carole Y. Taylor of the 4TH DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

SCB7PB

Member School Board District 7. Observed options: Cu, Ri, A, I.

SWC

Palm Beach Soil and Water Conservation District. Observed options: L, M, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

PALRE

Children's Service Council. Options: N, Y, A, I.

BBRE1

City of Boynton Beach. Ordinance 000-41. Options: N, Y, A, I.

BBRE2

City of Boynton Beach. Ordinance 000-43. Options: N, Y, A, I.

LARE1

Town of Lantana. Sale real property. Options: N, Y, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 447,466 592
USS 447,466 592
USR16 139,521 175
USR19 183,011 177
USR22 65,512 108
USR23 59,422 135
TRE 447,466 592
EDU 447,466 592
PUB2 447,466 592
STS27 76,217 89
STS31 39,627 58
STS35 80,291 127
SRH82 25,574 28
SRH83 62,462 84
SRH84 35,102 76
SRH85 49,671 65
SRH87 51,117 74
SRH88 74,788 87
SRH89 63,780 52
SRH91 20,897 21
CCC4 447,466 592
SHE5 447,466 592
TAX2 447,466 592
PPB1 126,723 202
PPB3 126,723 202
SC1 447,466 592
SC2 447,466 592
SC3 447,466 592
D41 447,466 592
D42 447,466 592
D43 447,466 592
D44 447,466 592
D45 447,466 592
D46 447,466 592
SCB7PB 56,213 83
SWC 447,466 592
A01 447,466 592
A02 447,466 592
A03 447,466 592
PALRE 447,466 592
BBRE1 20,877 36
BBRE2 20,877 36
LARE1 2,246 7

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Palm_Beach


# Load the full microdata
palm_beach_data <- get_county_data("Palm_Beach")

# Alternatively, using the county object directly
palm_beach_data <- as.data.frame(Palm_Beach)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Palm_Beach))


Pasco County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Pasco County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Pasco

Format

A county metadata object. The underlying microdata has 146,648 rows (one per voter) across 148 precincts and 29 columns:

COUNTY

County identifier ("Pasco").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR12

United States Representative Congressional District 12. Observed options: D, R, A, I.

USR5

United States Representative Congressional District 5. Observed options: D, R, A, I.

USR9

United States Representative Congressional District 9. Observed options: O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

STS13

State Senator - Senatorial District 13. Observed options: D, R, A, I.

SRH45

State Representative - House District 45. Observed options: R, A.

SRH46

State Representative - House District 46. Observed options: D, R, A, I.

SRH61

State Representative - House District 61. Observed options: D, R, A.

SHE4

Sheriff. Observed options: D, R, A, I.

COC1PAS

County Commissioner District 1. Observed options: D, R, A, I.

COC5PAS

County Commissioner District 5. Observed options: D, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D21

Shall Judge John R. Blue of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D22

Shall Judge Darryl C. Casanueva of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D23

Shall Judge Charles A. Davis, Jr. of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D24

Shall Judge Oliver L. Green of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D25

Shall Judge E. J. Salcines of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D26

Shall Judge Thomas E. Stringer of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D27

Shall Judge Edward F. Threadgill of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 146,648 148
USS 146,648 148
USR12 8,691 20
USR5 56,176 56
USR9 81,711 70
TRE 146,648 148
EDU 146,648 148
STS13 38,289 35
SRH45 54,914 57
SRH46 52,947 46
SRH61 38,350 40
SHE4 146,648 148
COC1PAS 146,648 148
COC5PAS 146,648 148
SC1 146,648 148
SC2 146,648 148
SC3 146,648 148
D21 146,648 148
D22 146,648 148
D23 146,648 148
D24 146,648 148
D25 146,648 148
D26 146,648 148
D27 146,648 148
A01 146,648 148
A02 146,648 148
A03 146,648 148

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Pasco


# Load the full microdata
pasco_data <- get_county_data("Pasco")

# Alternatively, using the county object directly
pasco_data <- as.data.frame(Pasco)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Pasco))


Pinellas County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Pinellas County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Pinellas

Format

A county metadata object. The underlying microdata has 406,956 rows (one per voter) across 377 precincts and 44 columns:

COUNTY

County identifier ("Pinellas").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR9

United States Representative Congressional District 9. Observed options: O, R, A, I.

USR10

United States Representative Congressional District 10. Observed options: O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

STS21

State Senator - Senatorial District 21. Observed options: D, O, R, A, I.

SRH47

State Representative - House District 47. Observed options: D, R, A, I.

SRH48

State Representative - House District 48. Observed options: O, R, A, I.

SRH49

State Representative - House District 49. Observed options: D, R, A, I.

SRH50

State Representative - House District 50. Observed options: D, R, A, I.

SRH51

State Representative - House District 51. Observed options: D, R, A, I.

SRH52

State Representative - House District 52. Observed options: D, R, A, I.

SRH53

State Representative - House District 53. Observed options: D, R, A, I.

COC3PIN

County Commissioner District 3. Observed options: O, R, A, I.

COC6PIN

County Commissioner District 6. Observed options: D, R, A, I.

COC7PIN

County Commissioner District 7. Observed options: D, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D21

Shall Judge John R. Blue of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D22

Shall Judge Darryl C. Casanueva of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D23

Shall Judge Charles A. Davis, Jr. of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D24

Shall Judge Oliver L. Green of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D25

Shall Judge E. J. Salcines of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D26

Shall Judge Thomas E. Stringer of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D27

Shall Judge Edward F. Threadgill of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

ELTC3

East Lake Tarpon. Special Fire Control District. Commissioner seat 3. Observed options: Bo, Sc, A, I.

LEAC1

Lealman. Special Fire Control District. Commissioner seat 1. Observed options: Ca, Ha, A, I.

PAHC2

Palm Harbor. Special Fire Control District. Commissioner seat 2. Observed options: An, He, Pe, Si, St, A, I.

ELTC4

East Lake Tarpon. Special Fire Control District. Commissioner seat 4. Observed options: De, Ho, A, I.

LEAC5

Lealman. Special Fire Control District. Commissioner seat 5. Observed options: Ad, Su, A, I.

PINC1

Pinellas Suncoast Fire and Rescue District. Commissioner seat 1 (precinct 419). Observed options: Ho, Mc, A, I.

PINC2

Pinellas Suncoast Fire and Rescue District. Indian Rocks Beach sub-district. Commissioner seat 2 (precinct 420). Observed options: Pi, Ri, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

PINRE1

Amends Charter to Provide Voting Standards Regarding County Administrator's Employment Based on Seven Member Board. Options: N, Y, A, I.

PINRE2

Pinellas County Charter Amendment Modifying Restrictions on Citizens' Initiative Process. Options: N, Y, A, I.

PINRE3

Authorizes the County to Establish Exclusive Methods, Criteria, and Geographic Boundaries for Voluntary Municipal Annexation. Options: N, Y, A, I.

PAHRE1

Palm Harbor. Senior recreational programs and facilities. Options: N, Y, A, I.

LEARE2

Lealman. Fire suppression service. Options: N, Y, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 406,956 377
USS 406,956 377
USR9 155,627 125
USR10 251,083 250
TRE 406,956 377
EDU 406,956 377
STS21 21,499 32
SRH47 10,552 9
SRH48 67,557 44
SRH49 54,734 48
SRH50 46,304 44
SRH51 40,675 43
SRH52 44,452 48
SRH53 48,083 49
COC3PIN 406,956 377
COC6PIN 105,612 93
COC7PIN 90,772 105
SC1 406,956 377
SC2 406,956 377
SC3 406,956 377
D21 406,956 377
D22 406,956 377
D23 406,956 377
D24 406,956 377
D25 406,956 377
D26 406,956 377
D27 406,956 377
ELTC3 16,629 13
LEAC1 17,102 20
PAHC2 30,456 23
ELTC4 16,629 13
LEAC5 12,710 20
PINC1 817 1
PINC2 1,994 1
A01 406,956 377
A02 406,956 377
A03 406,956 377
PINRE1 406,956 377
PINRE2 406,956 377
PINRE3 406,956 377
PAHRE1 30,456 23
LEARE2 17,102 20

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Pinellas


# Load the full microdata
pinellas_data <- get_county_data("Pinellas")

# Alternatively, using the county object directly
pinellas_data <- as.data.frame(Pinellas)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Pinellas))


Sarasota County ballot microdata (Florida 2000)

Description

Ballot-level microdata for Sarasota County, Florida general election, November 7, 2000. Each row represents one voter.

Usage

Sarasota

Format

A county metadata object. The underlying microdata has 163,750 rows (one per voter) across 159 precincts and 40 columns:

COUNTY

County identifier ("Sarasota").

PRECINCT

Precinct identifier within the county.

PRE

President and Vice President of the United States. Observed options: D, O, R, A, I.

USS

United States Senator. Observed options: D, O, R, A, I.

USR13

United States Representative Congressional District 13. Observed options: D, O, R, A, I.

TRE

State Treasurer. Observed options: D, R, A, I.

EDU

Commissioner of Education. Observed options: D, O, R, A, I.

SRH69_70

State Representative - House Districts 69 and 70 (combined). Observed options: D, R, A, I.

SRH71_74

State Representative - House Districts 71 and 74 (combined). Observed options: R, A, I.

SUP3

Supervisor of elections. Observed options: D, R, A, I.

COC1SAR

County Commissioner District 1. Observed options: D, R, A, I.

COC5SAR

County Commissioner District 5. Observed options: O, R, A, I.

CRB5

Charter Review Board. District 5. Observed options: D, R, A, I.

SC1

Justice of the Supreme Court R. Fred Lewis. Options: N, Y, A, I.

SC2

Justice of the Supreme Court Barbara J. Pariente. Options: N, Y, A, I.

SC3

Justice of the Supreme Court Peggy A. Quince. Options: N, Y, A, I.

D21

Shall Judge John R. Blue of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D22

Shall Judge Darryl C. Casanueva of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D23

Shall Judge Charles A. Davis, Jr. of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D24

Shall Judge Oliver L. Green of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D25

Shall Judge E. J. Salcines of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D26

Shall Judge Thomas E. Stringer of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

D27

Shall Judge Edward F. Threadgill of the 2ND DISTRICT court of appeal be retained in office?. Options: N, Y, A, I.

SCB3

Member School Board District 3. Observed options: Ko, Zu, A, I.

EWF4

Englewood Area Fire Control District Seat 4. Observed options: Ka, Ke, A, I.

EWF5

Englewood Area Fire Control District Seat 5. Observed options: Cy, Ha, A, I.

EWW1

Englewood Water District Seat 1. Observed options: Ma, Mo, A, I.

EWW2

Englewood Water District Seat 2. Observed options: Hu, Ma, Tr, A, I.

A01

Florida Transportation Initiative for statewide high speed monorail, fixed guideway or magnetic levitation system. Options: N, Y, A, I.

A02

Referendum No. 2: Circuit Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each judicial circuit. Options: N, Y, A, I.

A03

Referendum No. 3: County Court Judge Referendum (implementing Article V, Section 10 of the Florida Constitution). Local option, voted separately in each county. Options: N, Y, A, I.

SARRE1

Shall Chapter 00-480, Laws of Florida, providing for the appointment of board members of the Sarasota-Manatee Airport Authority, be approved?. Options: N, Y, A, I.

SARRE2

Charter Compliance with state law requirements for recall of county commissioners. Options: N, Y, A, I.

SARRE3

Removal of unconstitutional definition of 'Political Committee'. Options: N, Y, A, I.

SARRE4

Limitation on Political Committee Campaign Contributions. Options: N, Y, A, I.

SARRE5

Compliance with U.S. supreme court ruling on total campaign contribution caps. Options: N, Y, A, I.

SARRE6

Adoption of six-month county residency requirement for candidates. Options: N, Y, A, I.

NPC3

City North Port. Commissioner. Seat 3. Observed options: Fi, Mc, A, I.

VEN3

City of Venice. Council member. Seat 3. Observed options: Fa, Wi, A, I.

VEN4

City of Venice. Council member. Seat 4. Observed options: Br, Ho, A, I.

Voting-code conventions:

NA in a race column means that the voter was not eligible to vote in that race. A = blank vote (it also includes write-in votes, which are not recorded on the ballot images); I = invalid vote.

For partisan races, D = Democratic candidate, R = Republican candidate and O = candidate from another party. In some races, however, these codes may have a different meaning (e.g., candidate initials) and should be interpreted according to the coding of the specific race (see election_catalog).

For referendums, Y = yes and N = no.

Eligible voters and precincts by race:

Race Eligible voters Precincts
PRE 163,750 159
USS 163,750 159
USR13 163,750 159
TRE 163,750 159
EDU 163,750 159
SRH69_70 121,306 117
SRH71_74 32,142 33
SUP3 163,750 159
COC1SAR 163,750 159
COC5SAR 163,750 159
CRB5 163,750 159
SC1 163,750 159
SC2 163,750 159
SC3 163,750 159
D21 163,750 159
D22 163,750 159
D23 163,750 159
D24 163,750 159
D25 163,750 159
D26 163,750 159
D27 163,750 159
SCB3 163,750 159
EWF4 7,724 8
EWF5 7,724 8
EWW1 8,668 13
EWW2 8,668 13
A01 163,750 159
A02 163,750 159
A03 163,750 159
SARRE1 163,750 159
SARRE2 163,750 159
SARRE3 163,750 159
SARRE4 163,750 159
SARRE5 163,750 159
SARRE6 163,750 159
NPC3 9,350 9
VEN3 10,438 10
VEN4 10,438 10

Source

Own elaboration from raw ballot data made available to the authors through personal communication by Dan Keating (data reporter, The Washington Post) and the American National Election Studies (ANES, University of Michigan). Florida general election, November 7, 2000. Full data available at doi:10.17605/OSF.IO/NP73B.

See Also

get_county_data(), ei_summary(), election_catalog, list_elections()

Examples

# Inspect metadata
Sarasota


# Load the full microdata
sarasota_data <- get_county_data("Sarasota")

# Alternatively, using the county object directly
sarasota_data <- as.data.frame(Sarasota)

# Pass directly to ei_summary
obj <- ei_summary(c("PRE", "USS"), data = get_county_data(Sarasota))


Load the full microdata for a county object

Description

Calls get_county_data() using the county code stored in the object. This is the data counterpart to county_meta(): it converts the lightweight metadata object into the full voter-level data.

Usage

## S3 method for class 'county'
as.data.frame(x, ..., source = NULL)

Arguments

x

A county object (e.g. Lee).

...

Ignored.

source

Character string or NULL. Either a local directory path (e.g. "~/data/") or the base URL of a remote repository. If NULL, the source is resolved automatically (see Details).

Details

To avoid specifying source in every call, set options(data_dir) once at the start of your session or in your .Rprofile:

options(data_dir = "~/my_data/")   # local files
# or leave unset to use the online OSF repository

Value

A data.frame with one row per voter.

See Also

county, county_meta(), get_county_data()

Examples


lee <- as.data.frame(Lee)



The county class

Description

A county object is a lightweight metadata summary for a single county's ballot data file. It does not contain the microdata itself (one row per voter); it only stores precomputed statistics about that county's races, used to build help pages and to give a quick overview before downloading the full dataset.

Details

One such object exists per county (e.g. Lee), stored as a small package data object. Use county_meta() to retrieve one by county code, or get_county_data() / as.data.frame() to load the actual microdata.

Structure

A county object is a named list with the class attribute c("county", "list") and the following elements:

county

Character. The county code (e.g. "Lee").

n_voters_total

Integer. Total number of voters (rows) in the county's microdata file, regardless of eligibility in any particular race.

n_precincts_total

Integer. Total number of distinct precincts in the county.

elections

Character vector. Race codes present in this county's data file (a subset of election_catalog).

voters_by_election

Named integer vector. Number of eligible (non-NA) voters for each race in elections.

precincts_by_election

Named integer vector. Number of precincts with at least one eligible voter, for each race.

options_by_election

Named list of character vectors. The vote options observed in the data for each race (candidate codes or combinations, plus "A"/"I" when present).

See Also

Lee, county_meta(), get_county_data(), list_counties(), election_catalog


County catalog

Description

A named list mapping each county data file to the race codes it contains. Used internally to determine which county files must be loaded for a given set of races.

Usage

county_catalog

Format

A named list. Each element is named by the county code (matching the .RData filename without extension) and contains a character vector of the race codes present in that county's file.

Details

The county code is used to construct the filename: county "Lee" maps to Lee.RData. This list is consulted by get_election_data() and ei_summary() to determine which files to load.

See Also

election_catalog, list_counties(), get_county_data()

Examples

# Races available in Lee county
county_catalog[["Lee"]]

# All counties in the dataset
names(county_catalog)

Retrieve county metadata

Description

Returns the county metadata object for a given county. This is the metadata counterpart to get_county_data(): where get_county_data() loads the full microdata (heavy), county_meta() returns the lightweight summary (counts, races, observed vote options).

Usage

county_meta(county)

Arguments

county

Character string (county code, e.g. "Lee") or an object of class county (e.g. Lee). If an object is supplied, it is returned unchanged.

Value

An object of class county. See county for its structure.

See Also

county, get_county_data(), list_counties()

Examples

county_meta("Lee")
county_meta(Lee)      # pass-through: already a county object


Compute ecological inference summaries from ballot microdata

Description

Builds the objects needed for ecological inference over a set of races: marginal distributions per precinct for each race, a joint contingency array across all races and precincts, and its precinct-aggregated versions.

Usage

ei_summary(
  elections,
  data = NULL,
  source = NULL,
  format = c("lphom", "eipack")
)

Arguments

elections

Character vector of race codes (e.g. c("PRE", "USS")). All codes must be keys in election_catalog.

data

Optional data.frame. If provided, it must contain columns COUNTY, PRECINCT, and all codes in elections. If NULL (default), data are loaded automatically via get_election_data().

source

Character string or NULL. Data source override; see get_county_data(). Ignored when data is provided.

format

Character. Output format for the margins element:

  • "lphom" (default): a named list of data.frames, one per race. Compatible with lphom and related packages.

  • "eipack": a single wide data.frame with all races side by side (columns named ⁠<RACE>_<OPTION>⁠, e.g. PRE_R, PRE_D).

Details

All summaries share a common intersection universe: voters who were eligible to vote in every race in elections (i.e. non-NA in all selected columns). To obtain the full universe of a single race, pass only that race.

Vote codes

In the microdata, "A" denotes a blank vote and "I" an invalid vote; both are included as active categories. NA means the voter was not eligible in that race and defines the universe boundary.

Multi-member races

For races where voters could select more than one candidate (e.g. "HOS3"), each observed combination (e.g. "BauDuf") is treated as an atomic category. See election_catalog for the candidates field listing the individual candidates on the ballot.

Subsetting

Use the [ operator to extract a subset of races from an existing ei_summary object without reloading data:

obj3 <- ei_summary(c("PRE", "USS", "HOS3"))
obj2 <- obj3[c("PRE", "USS")]   # subset to 2 races

Value

An object of class "ei_summary" (a named list) with components:

margins

Marginal distributions per precinct. A named list of data.frames (format "lphom") or a single wide data.frame (format "eipack"). Each data.frame contains columns precinct_id, county_id, n_voters, and one column per vote option. n_voters is identical across all races because the universe is shared.

joint_precinct

Integer array of dimensions ⁠[opt_1 x ... x opt_k x precincts]⁠. NULL when only one race is requested. Summing over any race dimension reproduces the corresponding margin.

joint_total

Same array collapsed over precincts: ⁠[opt_1 x ... x opt_k]⁠. NULL when only one race is requested.

meta

Named list of metadata: elections, counties, n_precincts, n_voters, opt_levels, format, precinct_info, created_at.

If data is NULL and the data cannot be downloaded, a message is shown and NULL is returned.

See Also

ei_summary_random() get_election_data(), get_county_data(), to_lphom(), to_eipack(), list_elections()

Examples

# Using the built-in example dataset
obj <- ei_summary(c("PRE", "USS"), data = example_ballots)
print(obj)
summary(obj)


# Single race: margins only, no joint array
pres <- ei_summary("PRE")
summary(pres)

# Two races: margins + 3-D joint array [PRE x USS x precinct]
obj <- ei_summary(c("PRE", "USS"))
print(obj)
summary(obj)
dim(obj$joint_precinct)

# Three races
obj3 <- ei_summary(c("PRE", "USS", "HOS3"))
dim(obj3$joint_precinct)   # [opts_PRE x opts_USS x opts_HOS3 x n_precincts]

# Wide format for eipack-style packages
obj_wide <- ei_summary(c("PRE", "USS"), format = "eipack")



Compute ecological inference summaries with random voter aggregation

Description

Randomly assigns voters to artificial units and computes ecological inference summaries, ignoring the geographic boundaries of real precincts. This allows assessing how sensitive the results are to the specific way voters are grouped — a concern known in the literature as the Modifiable Areal Unit Problem (MAUP).

Usage

ei_summary_random(
  elections,
  data = NULL,
  source = NULL,
  format = c("lphom", "eipack"),
  n_units = NULL,
  unit_size = NULL,
  size_range = NULL,
  seed = NULL
)

Arguments

elections

Character vector of race codes (e.g. c("PRE", "USS")). All codes must be keys in election_catalog.See ei_summary().

data

Optional data.frame. If provided, must contain columns COUNTY, PRECINCT, and all codes in elections. If NULL (default), data are loaded automatically via get_election_data().

source

Character string or NULL. Data source override; see get_county_data(). Ignored when data is provided.

format

Character. Output format for the margins element:

  • "lphom" (default): a named list of data.frames, one per race. Compatible with lphom and related packages.

  • "eipack": a single wide data.frame with all races side by side (columns named ⁠<RACE>_<OPTION>⁠, e.g. PRE_R, PRE_D).

n_units

Integer or NULL. Number of random units to create. NULL (default) uses the same number of precincts as in the data. When unit_size or size_range is also supplied, see the precedence rules in the Details section.

unit_size

Integer or NULL. Fixed number of voters per unit. If N (the number of eligible voters) is not an exact multiple of unit_size, a smaller residual unit containing the remaining voters is created. Takes precedence over size_range and n_units; both are ignored with a warning if unit_size is specified.

size_range

Integer vector of length 2, c(min, max), or NULL. When used alone (without n_units), units are created by drawing sizes uniformly from ⁠[min, max]⁠ until all N voters are assigned; the last unit may be smaller than min. When used with n_units, the effective interval is the largest symmetric range around the required mean (N / n_units) that fits within ⁠[min, max]⁠; the last unit absorbs the residual. Takes precedence over n_units. Ignored when unit_size is specified.

seed

Integer or NULL. Random seed passed to set.seed() before shuffling voters, enabling reproducible results. NULL (default) uses the current random state.

Details

The total number of votes for each option is identical to that returned by ei_summary() on the same data — only the distribution of votes across units changes.

The function returns a standard ei_summary object, fully compatible with to_lphom(), to_eipack(), and subset_elections(). The randomisation parameters are stored in meta$random for reproducibility and auditing.

To repeat the randomisation n times (e.g. for a sensitivity analysis), call the function inside lapply(), varying seed each time:

results <- lapply(1:3, function(i)
  ei_summary_random(c("PRE", "USS"), data = d, seed = i))

Value

An object of class "ei_summary" with the same structure as ei_summary(), which contains the components: margins, joint_precinct, joint_total and meta; see ei_summary() for details. To document the randomisation the meta component includes, in addition to the fields elections, counties, n_precincts, n_voters, opt_levels, format, precinct_info, created_at the field random, with the following components:

method

Character string describing the aggregation method used and the resulting unit structure.

n_units

Integer. Number of random units created.

unit_sizes

Integer vector of length n_units. Size (number of voters) of each unit. Always sums to meta$n_voters.

seed

The seed supplied to seed, or NULL if none.

n_units_arg

Value of the n_units argument as supplied by the user.

unit_size_arg

Value of the unit_size argument as supplied by the user.

size_range_arg

Value of the size_range argument as supplied by the user.

Argument precedence

When multiple sizing arguments are supplied simultaneously, they are resolved in this order (highest to lowest priority):

  1. unit_size — fixed size per unit; n_units and size_range are ignored with a warning.

  2. size_range — random sizes within bounds; if n_units is also supplied, the effective sampling interval is the largest symmetric interval around the required mean (N / n_units) that fits within ⁠[min, max]⁠. The last unit absorbs the residual and may fall slightly outside the effective interval. A warning is issued if the required mean falls outside ⁠[min, max]⁠, in which case all units are assigned approximately equal sizes.

  3. n_units — number of units; sizes are drawn proportionally from the real precinct size distribution.

  4. Default (no sizing argument) — same number of units as real precincts; sizes match the real precinct size distribution; voters are randomly shuffled across units.

Universe

As in ei_summary(), only voters non-NA in all elections simultaneously are included (the intersection universe). The randomisation is applied to this universe, not to the full dataset. The meta$n_voters field of the returned object always refers to this intersection count.

Relationship to ei_summary()

ei_summary_random() produces an object of the same class and structure as ei_summary(), and is fully compatible with to_lphom(), to_eipack(), and subset_elections(). The only difference is that voters are grouped into random units rather than real (geographic) precincts. To compare random and real aggregations directly, run both functions on the same data object:

d    <- get_election_data(c("PRE", "STS35"))
real <- ei_summary(c("PRE", "STS35"), data = d)
rnd  <- ei_summary_random(c("PRE", "STS35"), data = d, seed = 1)

See Also

ei_summary(), subset_elections(), to_lphom(), to_eipack(), get_election_data()

Examples

# Using the built-in example dataset
obj <- ei_summary(c("PRE", "USS"), data = example_ballots)
print(obj)
summary(obj)


# Default: same number and size distribution as real precincts
obj <- ei_summary_random(c("PRE", "STS35"), seed = 42)

# 200 units with sizes proportional to the real precinct distribution
obj <- ei_summary_random(c("PRE", "STS35"), n_units = 200, seed = 42)

# Fixed size of 500 voters per unit (residual unit if N not divisible)
obj <- ei_summary_random(c("PRE", "STS35"), unit_size = 500, seed = 42)

# Random size between 200 and 800 voters per unit
obj <- ei_summary_random(c("PRE", "STS35"),
                         size_range = c(200, 800), seed = 42)

# 200 units with random sizes between 100 and 1000
obj <- ei_summary_random(c("PRE", "STS35"),
                         n_units = 200, size_range = c(100, 1000),
                         seed = 42)

# Sensitivity analysis: three random aggregations
hig <- get_county_data("Highlands")
if (!is.null(hig))
  results <- lapply(1:3, function(i)
    ei_summary_random(c("PRE", "USS"), data = hig, seed = i))



Election catalog

Description

A named list documenting all races available in the Florida 2000 general election dataset. Each element is named by the election code used as a column name in the county microdata files.

Usage

election_catalog

Format

A named list. Each element contains:

type

Race type: "single_member", "multi_member", or "referendum".

office

Full name of the office or ballot measure.

level

Level of government of the race, following the types of government of the U.S. Census of Governments: "federal", "state", "county", "municipal" (cities, towns and villages) or "special_district" (independent single-purpose districts such as fire, water, hospital or community development districts).

counties

Character vector of county codes/names that include this race, or the string "all" if every county in the dataset participates.

vote_for

Maximum number of candidates the voter could select.

options

Character vector of the codes used in the data: one per candidate or answer (e.g. "Bau", "Duf"), plus, in multi-member races, the combinations of candidates a voter can select (e.g. "BauDuf"), and "A" and "I".

candidates

Character vector of the individual candidates or answers on the ballot (e.g. c("Barrett", "Bauchert", "Berkowitz", "Brown", "Duff", "Abstention", "Invalid vote")).

Details

In the microdata files, votes are recorded as follows:

The distinction between "A", "I", and NA is critical for ecological inference: only NA values define the universe boundary.

See Also

county_catalog, list_elections(), list_counties(), ei_summary()

Examples

# Inspect the presidential race entry
election_catalog[["PRE"]]

# List all federal races
list_elections(level = "federal")

Example ballot-level data

Description

A small simulated dataset used in examples and tests. The dataset contains 100 simulated observations from five simulated precincts in Lee county, with presidential and U.S. Senate vote categories.

Usage

data(example_ballots)

Format

A data frame with 100 rows and 4 variables:

COUNTY

County name.

PRECINCT

Precinct identifier.

PRE

Presidential vote category.

USS

U.S. Senate vote category; may contain missing values.

Source

Simulated data generated for examples.


Load raw microdata for a single county

Description

Reads a county-level .RData file and returns its contents as a data.frame. The data source is resolved in this order:

  1. The source argument (if not NULL).

  2. getOption("data_dir") (set once with options(data_dir = ...)).

  3. The default OSF repository (online).

Usage

get_county_data(county, source = NULL)

Arguments

county

Character string. County code, e.g. "Lee". Must be a key in county_catalog.

source

Character string or NULL. Either a local directory path (e.g. "~/data/") or the base URL of a remote repository. If NULL, the source is resolved automatically (see Details).

Details

To avoid specifying source in every call, set options(data_dir) once at the start of your session or in your .Rprofile:

options(data_dir = "~/my_data/")   # local files
# or leave unset to use the online OSF repository

Files downloaded from a remote source are cached for the rest of the R session, so each county is downloaded only once.

Value

A data.frame with one row per voter and columns:

If the file cannot be downloaded (e.g. no internet connection), a message is shown and NULL is returned.

See Also

get_election_data(), ei_summary(), list_counties()

Examples


# From the online repository
lee <- get_county_data("Lee")

# From a local directory containing the .RData files
dir <- tempdir()
Lee <- lee
save(Lee, file = file.path(dir, "Lee.RData"))
lee <- get_county_data("Lee", source = dir)



Load raw microdata for one or more races

Description

Determines which county files are needed for the requested races, loads them (downloading if necessary), and returns a combined data.frame with only the relevant columns.

Usage

get_election_data(elections, source = NULL)

Arguments

elections

Character vector of race codes, e.g. c("PRE", "USS"). All codes must be keys in election_catalog.

source

Character string or NULL. Either a local directory path (e.g. "~/data/") or the base URL of a remote repository. If NULL, the source is resolved automatically (see Details).

Details

The counties to load are determined automatically from election_catalog. For races spanning all counties (counties = "all"), every county in county_catalog is loaded. For district-level races, only the relevant counties are loaded.

To avoid specifying source in every call, set options(data_dir) once at the start of your session or in your .Rprofile:

options(data_dir = "~/my_data/")   # local files
# or leave unset to use the online OSF repository

Value

A data.frame with columns COUNTY, PRECINCT, and one column per requested race. Rows from all relevant counties are combined via rbind. Voters not eligible for a given race have NA in that column. If a county file cannot be downloaded, a message is shown and NULL is returned.

See Also

get_county_data(), ei_summary()

Examples


# Presidential and Senate races (all counties)
df <- get_election_data(c("PRE", "USS"))

# Including a district-level race (only counties with that race)
df <- get_election_data(c("PRE", "HOS3"))



List available counties

Description

Returns a data.frame with each county in the dataset and the number of races in its data file.

Usage

list_counties()

Value

A data.frame with columns county and n_elections.

See Also

county_catalog, list_elections()

Examples

list_counties()


List available races

Description

Returns a summary data.frame of the races available in the dataset, optionally filtered by type or level.

Usage

list_elections(type = NULL, level = NULL)

Arguments

type

Optional. Filter by race type: "single_member", "multi_member", or "referendum".

level

Optional. Filter by level of government: "federal", "state", "county", "municipal", or "special_district".

Value

A data.frame with columns code, office, type, level, and counties.

See Also

election_catalog, list_counties()

Examples

list_elections()
list_elections(level = "federal")
list_elections(type = "referendum")


Print a county metadata object

Description

Displays the schema and summary statistics for the county's ballot data: races present, vote options observed in each race, total voters, precincts, and per-race eligibility counts.

Usage

## S3 method for class 'county'
print(x, ...)

Arguments

x

A county object (e.g. Lee).

...

Ignored.

Value

The input object x, returned invisibly. Called for its side effect of printing a structured metadata summary to the console.

See Also

county, county_meta(), as.data.frame.county


Print an ei_summary object

Description

Print an ei_summary object

Usage

## S3 method for class 'ei_summary'
print(x, ...)

Arguments

x

An "ei_summary" object.

...

Ignored.

Value

The input object x, returned invisibly. Called for its side effect of printing a structured summary to the console.


Subset an ei_summary to fewer races

Description

Extracts a subset of races from an existing "ei_summary" object without reloading or recomputing from raw data. Vote counts remain exactly as in the original object because the universe is unchanged.

Usage

subset_elections(x, elections)

## S3 method for class 'ei_summary'
x[elections]

Arguments

x

An "ei_summary" object.

elections

Character vector of race codes to retain. Must be a subset of x$meta$elections.

Details

The [ operator is also available as a shorthand: x[elections] is equivalent to subset_elections(x, elections).

Value

A new "ei_summary" object restricted to elections.

Examples


obj3 <- ei_summary(c("PRE", "USS", "HOS3"))

# Equivalent ways to extract a 2-race subset
obj2 <- subset_elections(obj3, c("PRE", "USS"))
obj2 <- obj3[c("PRE", "USS")]

obj1 <- obj3["PRE"]   # single race: no joint array



Summarise an ei_summary object

Description

Prints aggregate vote totals and percentages for each race, and (when there are exactly two races) the full joint contingency table.

Usage

## S3 method for class 'ei_summary'
summary(object, ...)

Arguments

object

An "ei_summary" object.

...

Ignored.

Value

The input object object, returned invisibly. Called for its side effect of printing aggregate vote totals and the joint contingency table (when two races are present) to the console.


Convert an ei_summary to eipack wide format

Description

Converts the margins element to a single wide data.frame where columns are named ⁠<RACE>_<OPTION>⁠ (e.g. PRE_R, PRE_D).

Usage

to_eipack(x)

Arguments

x

An "ei_summary" object.

Value

An "ei_summary" object with margins as a wide data.frame and meta$format == "eipack".

See Also

to_lphom(), ei_summary()


Convert an ei_summary to lphom list format

Description

Converts the margins element to a named list of data.frames (one per race). This is the default format of ei_summary() and the input format expected by lphom and related ecological inference functions.

Usage

to_lphom(x)

Arguments

x

An "ei_summary" object.

Value

An "ei_summary" object with margins as a named list of data.frames and meta$format == "lphom".

See Also

to_eipack(), ei_summary()