Data Science Dispatch

Do Democratic and Republican voters have different views of primary and secondary schooling?

Using the American National Election Survey (ANES) 2024 Pilot Study, our report aims to analyze public perceptions of education in the 2024 election.

By Chad Vo, Ambro Quach, Yoko Morishita & Rohan Kapur

Statistical InferenceHypothesis Testing9 min read

How much should schools teach about racism?

Political Identity
Republican
15%21%64%
Democrat
59%32%9%
10050050100

Percentage of Voters

A great dealA lotA moderate amountA littleNone at all
p < 2.2e-16
a real divide
Democrats and Republicans split on what belongs in the lesson plan — significant past any reasonable doubt (Wilcoxon rank-sum).

1. Importance and Context

The aim — Motivate the analysis: introduce the topic, explain why the question is interesting and to whom, and connect it to the concepts and statistical techniques that follow.

The American National Election Studies (ANES) is a long-running survey series that collects data on voting behavior, political attitudes, and public opinion in the United States. The ANES 2024 Pilot Study is a cross-sectional survey designed to test new questions for potential inclusion in the ANES 2024 Time Series Study and to provide insights into public opinion during the early phase of the 2024 presidential election campaign. This study addresses various topics, including voter preferences, economic concerns, employment satisfaction, education, political tolerance, and social issues such as gender identity and racial attitudes. This dataset is a valuable resource for analyzing political ideology, policy preferences, and demographic trends in the context of the 2024 election.

At first glance, education is a neutral topic for many of us. It is centered on acquiring knowledge, honing skills, and fostering intellectual growth. However, as education shapes values, critical thinking, and societal norms, it has become a focal point in the current U.S. political climate, often entangled in ideological and political debates. To better understand the larger national conversation surrounding education, we turn to data for insights. Using the American National Election Survey (ANES) 2024 Pilot Study, our report aims to analyze public perceptions of education in the 2024 election. Voters in the ANES survey were asked about their opinions on education in public schools, college professors, and the idea that higher education might be tilted toward liberal thinking. This information helps us form the research question we want to answer:

Do Democratic and Republican voters have different views of primary and secondary schooling?

Our intended audience is people interested in public policy and education, but with limited knowledge in statistics. Our goal is to communicate our hypothesis tests and key findings, so that people can have the same understanding of each party's views.

2. Data and Methodology

The aim — Define and operationalize the concepts (who counts as a voter, a Democrat, a Republican), document the ANES data and every wrangling decision, state the hypotheses precisely, then select the appropriate test and weigh each of its assumptions.

To analyze the relationship between political affiliation and attitudes toward education, we need to define three key concepts in our research: who qualifies as a voter, who identifies as a Democrat or Republican, and what constitutes differing views on education. A voter is defined as an individual who is registered to vote in the 2024 election. A Democrat or Republican typically refers to someone who aligns with a specific political party. Differing views on education encompass variations in beliefs, attitudes, and priorities regarding public and higher education's roles, content, and policies.

To analyze these concepts using ANES data, we focus on variables that capture voter registration status and political affiliation. Votereg indicates whether a respondent is registered to vote, while political affiliation is determined through pid_pid1d, pid_pid1r, and pid_partylean. To assess public perspectives on education, we identify several variables reflecting attitudes toward public schools and higher education: group_colprofs – a thermometer rating for college professors; school_racism – views on how much emphasis schools should place on teaching about racism; school_gender – views on how much emphasis schools should place on teaching about gender and sexual orientation (optional).

We identified group_colprofs, school_racism, and school_gender as the most relevant variables for our analysis. Group_colprofs measures public sentiment toward college professors, capturing partisan differences in trust and favorability toward educators. School_racism and school_gender reflect broader attitudes toward curriculum content, specifically on race and gender topics, allowing us to examine differences in educational perspectives between Democrats and Republicans. We chose race over gender for this study because in general, racial attitudes have a stronger influence on political preferences through ideological associations. These variables provide a more straightforward insight into public attitudes toward education and its political landscape.

The thermometer will be kept at its original scale, allowing for mean comparisons and distribution analysis across political affiliations. For school_racism, we will assign numeric scores to each response (e.g., None at all = 5, A great deal = 1), allowing us to preserve the ordinal structure of the variable.

In the data wrangling process, we refined the original ANES 2024 Pilot Study dataset to include a specific set of variables, as detailed in section 2, to conduct this study on varying perspectives of education. We refined our dataset by filtering for registered voters (using votereg) and "Weighted Complete" responses to ensure data quality. Observations with missing values in key variables - such as political affiliation (pid_pid1d, pid_pid1r, pid_partylean) and education-related measures (school_racism, school_gender) - were removed. Invalid entries (e.g., "inapplicable", "legitimate skip", "inapplicable, legitimate skip") were also excluded. We then categorized party affiliation as follows to align with bipartisan framework. Democrats and Republicans are based on pid_pid1d and pid_pid1r. Independents and Other Party are retained as-is unless pid_partylean indicated a partisan leaning, in which case they were reclassified accordingly. The final classification is stored in the primary_party column.

We also converted text-based responses into ordinal numeric variables to support statistical testing while preserving contextual integrity. Lastly, we assessed potential response bias in extreme values (0-10 and 90-100) in group_colprofs but found no clear evidence of extreme outliers. As a result, the dataset remains unchanged in this regard. By consolidating party affiliation and addressing missing or extreme values, we have refined the dataset for analysis. The wrangling code can be found in our team repository.

Primary Hypothesis:

H0: There is no difference in how Democrats and Republicans view primary and secondary schooling.

HA: There is a significant difference in how Democrats and Republicans view primary and secondary schooling.

Secondary Hypotheses:

Hypothesis 1: Ratings of College Professors

H0: There is no difference in how parties rate college professors

HA: There is a significant difference in how parties rate college professors

Hypothesis 2: Emphasis on teaching racism in schools

H0: There is no significant difference in how each respective party emphasizes teaching racism in schools

HA: There is a significant difference in how each respective party emphasizes teaching racism in schools

To examine our hypotheses, we chose to explore several different testing methods but chose to focus on Wilcoxon Rank-Sum Test as the primary and most appropriate test for this analysis. Providing the key variables, we immediately met the test's assumptions requirements because both college professors ratings and school racism in schools are measured on the ordinal scales. Because the distance in values cannot be measured, we didn't treat the college professor rating as a metric. Second, the assumption of IID data is also met per the nature of the ANES dataset and the documentation provided as the it's a nationally representative survey conducted using random sampling methods, which ensure independence among observations. Additionally, through our data wrangling process, we also removed invalid and incomplete observations to ensure there's great balance within all observations. Despite the fit, there's some limitations to the Wilcoxon Rank-Sum Test as it only considers the relative ranking of data points and does not put the the magnitude of differences between groups, which makes it less powerful that other parametric tests like the two-sample t-test where normality assumptions hold. Therefore, as a secondary check, we conducted the Shapiro-Wilk Test as a backup method. However, during the evaluation of the normality assumption, the produced p-value was less than 2.2e - 16, which leads us to reject the null hypothesis of normality. This finding indicates that the variable of school racism is not normally distributed, which does not meet the key assumption required for this test. Provided this limitation alone, we chose to proceed only with the Wilcoxon Rank-Sum Test as it's more appropriate for this exercise.

3. Results

The aim — Report both the statistical significance and the practical significance — the direction and magnitude of the effect, not just the p-value — carried by plots that read clearly in plain English.

The Wilcoxon rank-sum test results were to reject the null hypothesis in all cases. This illustrates significant differences between Democrats and Republicans in their perceptions of college professors, and the emphasis on teaching racism in schools. Specifically, Democrats tend to rate college professors higher than Republicans as shown in Figure 1.

Figure 1: Rate of College Professor

Figure 1: Rate of College Professor

Figure 2 shows that 59% of Democrats consider education about racism in schools is important, whereas 64% of Republicans consider it is not important. These boxplots further support the differences in views. Given the large sample size and highly significant p-values, these findings are statistically strong and reflect real political divides in education-related attitudes.

Figure 2: Emphasis on Racism Education

Figure 2: Emphasis on Racism Education

Ratings of College Professors: The test statistic (W = 63,513) and p-value (<2.2e-16) indicate a significant difference in how Democrats and Republicans view college professors.

Emphasis on Teaching Racism in Schools: The test statistic (W = 248,725) and p-value (<2.2e-16) confirm a significant partisan divide on this issue.

4. Discussion

The aim — Step back to what the analysis can and cannot claim — the limits of these specific survey items, and what a fuller, multivariate study would add.

Although our data strongly supports the difference between parties' views, there is a limitation to generalize our insights to answer the question on "views of primary and secondary schooling" because all available variables are designed to ask about specific topics. Besides, there may be other variables that have a strong relationship with the difference in responses, such as voters' demographics and locations. For future study, we recommend a deep dive involving multivariate analysis.

Anatomy

  1. Introduction

    Motivate the analysis — introduce the topic, explain why the question matters and to whom, and connect it to the statistical techniques that follow.

  2. Conceptualization & Operationalization

    Define the concepts (voter, Democrat, Republican), explain precisely how each is measured, and flag any gap between the conceptual and operational definitions.

  3. Data Wrangling

    A clean, legible pipeline from raw data to analysis — a single source of truth, clear variable names, numbers computed in code, not hard-typed.

  4. Data Understanding

    Enough background on the ANES for a reader who has never heard of it to place the results in context.

  5. Plots & Tables

    At least one visualization that transmits the finding clearly — plain-English labels, honest axes, accessible colors, good information-to-ink.

  6. Stating a Hypothesis

    The correct null hypothesis for the test, written in mathematically precise language.

  7. Test Selection & Evaluation of Assumptions

    A fully appropriate test, with every assumption discussed — how well it holds and the consequences if violated, not a binary pass/fail.

  8. Test Results & Interpretation

    Both statistical and practical significance — an effect-size measure, the direction and magnitude of the effect in context, with the test code shown.

  9. Overall Effect

    A professional, presentable report any reader could pick up and take away its aims, intent, and conclusions.

A statistics project from UC Berkeley's School of Information, by Chad Vo, Ambro Quach, Yoko Morishita, and Rohan Kapur.

More From Data Science Dispatch