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
(v240103a–v240103d), the recommended set for most analyses.
anes_2024A data frame with 5,521 rows and 19 variables:
Pre-election weight (FTF+Web combined). Use for variables asked before November 5, 2024.
Post-election weight (FTF+Web combined). Use for variables asked after November 5, 2024.
PSU (FTF+Web combined). Use as the cluster ID for variance estimation.
Stratum (FTF+Web combined). Use as the stratification variable.
2024 Time Series Case ID. Unique respondent identifier.
Sample type: 1 = Panel, 2 = Fresh Web, 3 = Fresh
FTF, 4 = GSS.
Pre/Post interview completion: 1 = Pre-election only,
2 = Pre- and post-election.
State FIPS code.
Census region: 1 = Northeast, 2 = Midwest,
3 = South, 4 = West.
Age on Election Day (summary). Top-coded at 80.
-2 = missing.
Sex: 1 = male, 2 = female.
Race/ethnicity (5-category summary): White non-Hispanic, Black non-Hispanic, Hispanic, Asian/NHPI non-Hispanic, Other/Multiracial non-Hispanic.
Education (5-category summary): 1 = less than HS,
2 = HS diploma, 3 = some college, 4 = bachelor's degree,
5 = graduate degree.
Household income (28 categories from < $5,000 to $250,000+).
Liberal-conservative self-placement (7-point scale):
1 = extremely liberal, 7 = extremely conservative.
99 = haven't thought about this.
Party identification strength: 1 = strong,
2 = not very strong.
Party identification lean (Independents): 1 = closer to
Republican, 2 = neither, 3 = closer to Democrat.
Did respondent vote for President (POST): 1 = yes,
2 = no.
Presidential vote choice (POST): 1 = Harris,
2 = Trump, 3 = RFK Jr., 4 = West, 5 = Stein, 6 = Other.
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,
nest = TRUE
)# Post-election analysis (validated vote choice)
svy_post <- as_survey(anes_2024,
ids = v240103c,
strata = v240103d,
weights = v240103b,
nest = TRUE
)
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.
# Variables in the dataset
names(anes_2024)
# Create pre-election design
svy <- as_survey(
anes_2024,
ids = v240103c,
strata = v240103d,
weights = v240103a,
nest = TRUE
)
# Inspect variable label (ANES uses opaque V-codes; labels give context)
attr(anes_2024$v241177, "label")
# Inspect value labels, including missing-value codes
attr(anes_2024$v241177, "labels")
Run the code above in your browser using DataLab