Issues candidates should talk more about

Application exercise

In this application exercise, we’ll do inference tables – categorical variables with many levels.

Packages

We’ll use the tidyverse and tidymodels packages.

library(tidyverse)
library(tidymodels)
library(ggthemes)

Data

A September 16-19, 2023, asked North Carolina voters, among other issues, about issues of equality and women’s progress. Specifically, one of the questions asked:

If you had to choose just one issue that you would like candidates to talk more about in the 2024 campaigns, what would that issue be?

  • Economy

  • Abortion/Reproductive rights

  • Immigration

  • Crime

  • Gun rights/restrictions

  • Something else

  • Don’t know

The survey also asked respondents’ party affiliation:

What political party do you most identify with?

  • Democrat

  • Republican

  • Unaffiliated

  • Other

The results of this survey are summarized in this report and the data can be found in your data folder: candidate-talk.csv.

Hypotheses

Exercise 1

State the hypotheses for evaluating whether the issue of choice is independent of party affiliation.

Add response here.

Data

Exercise 2

Load the data.

# add code here

Exercise 3

Create a two-way table of the responses across the two age groups and visualize the frequency distribution.

# add code here
# add code here

Exercise 4

Which do you think should be the explanatory variable and which the response variable? Accordingly, create a visualization that shows the correct conditional probabilities.

# add code here

Testing

Exercise 5

Calculate the observed sample statistic.

# add code here

Exercise 6

Conduct the hypothesis test using randomization and visualize and report the p-value.

# add code here

Exercise 7

What is the conclusion of the hypothesis test?

Add response here.