Skip to contents

A 19-variable extract from the 2024 American National Election Studies (ANES) Time Series Study, a landmark biennial pre- and post-election survey of the American electorate. Fielded via face-to-face interview and web (n = 5,521). This extract uses the FTF + Web combined design variables (v240103av240103d), the recommended set for most analyses.

Usage

anes_2024

Format

A data frame with 5,521 rows and 19 variables:

v240103a

Pre-election weight (FTF+Web combined). Use for variables asked before November 5, 2024.

v240103b

Post-election weight (FTF+Web combined). Use for variables asked after November 5, 2024.

v240103c

PSU (FTF+Web combined). Use as the cluster ID for variance estimation.

v240103d

Stratum (FTF+Web combined). Use as the stratification variable.

v240001

2024 Time Series Case ID. Unique respondent identifier.

v240003

Sample type: 1 = Panel, 2 = Fresh Web, 3 = Fresh FTF, 4 = GSS.

v240002c

Pre/Post interview completion: 1 = Pre-election only, 2 = Pre- and post-election.

v243002

State FIPS code.

v243007

Census region: 1 = Northeast, 2 = Midwest, 3 = South, 4 = West.

v241458x

Age on Election Day (summary). Top-coded at 80. -2 = missing.

v241550

Sex: 1 = male, 2 = female.

v241501x

Race/ethnicity (5-category summary): White non-Hispanic, Black non-Hispanic, Hispanic, Asian/NHPI non-Hispanic, Other/Multiracial non-Hispanic.

v241465x

Education (5-category summary): 1 = less than HS, 2 = HS diploma, 3 = some college, 4 = bachelor's degree, 5 = graduate degree.

v241566x

Household income (28 categories from < $5,000 to $250,000+).

v241177

Liberal-conservative self-placement (7-point scale): 1 = extremely liberal, 7 = extremely conservative. 99 = haven't thought about this.

v241222

Party identification strength: 1 = strong, 2 = not very strong.

v241223

Party identification lean (Independents): 1 = closer to Republican, 2 = neither, 3 = closer to Democrat.

v242066

Did respondent vote for President (POST): 1 = yes, 2 = no.

v242067

Presidential vote choice (POST): 1 = Harris, 2 = Trump, 3 = RFK Jr., 4 = West, 5 = Stein, 6 = Other.

Source

American National Election Studies. 2024 Time Series Study. https://electionstudies.org (free account required to download raw data; the processed .rda is included in the package). Prepared by data-raw/prepare-anes-2024.R.

Details

Survey design: Stratified cluster — use Taylor series linearization. Two weights are available depending on whether the analysis uses pre- or post-election variables:

# Pre-election analysis (party ID, ideology, candidate preference)
svy_pre <- as_survey(anes_2024,
  ids     = v240103c,
  strata  = v240103d,
  weights = v240103a
)

# Post-election analysis (validated vote choice)
svy_post <- as_survey(anes_2024,
  ids     = v240103c,
  strata  = v240103d,
  weights = v240103b
)

Missing value codes: The ANES uses negative integer codes for missing data throughout: -9 = Refused, -8 = Don't know, -4 = Technical error, -1 = Inapplicable, and others. These must be recoded to NA before analysis. Check attr(anes_2024$v241177, "labels") for the full set of codes for a given variable.

Metadata: All columns carry variable labels and value labels as R attributes from the original Stata file, automatically extracted into surveycore's metadata system when you call as_survey().

  • Variable labels ("label" attribute): A human-readable description of each column. Example: attr(anes_2024$v241550, "label") returns "PRE: What is your sex?" (or similar ANES phrasing).

  • Value labels ("labels" attribute): A named numeric vector mapping each code to its meaning, including all missing-value codes. Example: attr(anes_2024$v241550, "labels") returns a vector with entries for Male, Female, and the applicable negative missing codes.

Examples

# Variables in the dataset
names(anes_2024)
#>  [1] "v240001"  "v240003"  "v240002c" "v240103a" "v240103b" "v240103c"
#>  [7] "v240103d" "v243002"  "v243007"  "v241458x" "v241550"  "v241501x"
#> [13] "v241465x" "v241566x" "v241177"  "v241222"  "v241223"  "v242066" 
#> [19] "v242067" 

# Create pre-election design
# svy <- as_survey(anes_2024, ids = v240103c, strata = v240103d,
#                  weights = v240103a)

# Inspect variable label (ANES uses opaque V-codes; labels give context)
attr(anes_2024$v241177, "label")
#> [1] "PRE: 7pt scale liberal-conservative self-placement"

# Inspect value labels, including missing-value codes
attr(anes_2024$v241177, "labels")
#>                         -9. Refused                           -4. Error 
#>                                  -9                                  -4 
#>                1. Extremely liberal                          2. Liberal 
#>                                   1                                   2 
#>                 3. Slightly liberal     4. Moderate; middle of the road 
#>                                   3                                   4 
#>            5. Slightly conservative                     6. Conservative 
#>                                   5                                   6 
#>           7. Extremely conservative 99. Haven't thought much about this 
#>                                   7                                  99