I will be analyzing data from the 2018 VDSG “Voter” Dataset to determine whether or not there is a relationship between political party identification, and support for affirmative action. Specifically, I hypothesize that Democrats are more likely to favor affirmative action than Republicans.
Below is a preview of the data:
## # A tibble: 6 x 2
## PartyIdentification AffirmativeAction
## <chr> <chr>
## 1 Democrat Favor
## 2 Republican Oppose
## 3 Republican Favor
## 4 Republican Oppose
## 5 Democrat Favor
## 6 Democrat Favor
Below are the expected values, which we would observe if the null hypothesis were true. As a reminder, the null hypothesis is that political party identification and support for affirmative action are independent of one another.
## $expected
## voter$AffirmativeAction
## voter$PartyIdentification Favor Not sure Oppose
## Democrat 963.931 692.9668 1327.102
## Republican 740.069 532.0332 1018.898
Below are the observed values, as summarized from the voter dataset. These values are compared against the expected values to determine whether or not the two variables are independent of one another.
## $observed
## voter$AffirmativeAction
## voter$PartyIdentification Favor Not sure Oppose
## Democrat 1502 850 632
## Republican 202 375 1714
Upon initial comparison, it seems that there is a substantial difference between the expected values and the observed values. For example:
I suspect that support for affirmative action (dependent variable), depends on a persons political identity (independent variable). The crosstab below shows how respondents in each political party distribute in their support for affirmative action (row %).
##
## Favor Not sure Oppose
## Democrat 0.50 0.28 0.21
## Republican 0.09 0.16 0.75
This crosstab lends further general support to my hypothesis.
##
## Pearson's Chi-squared test
##
## data: voter$PartyIdentification and voter$AffirmativeAction
## X-squared = 1611.8, df = 2, p-value < 2.2e-16
The results of the chi-square test support my rejection of the null hypothesis. The p-value, indicated in scientific notation as <2.2e-16, is less than the threshold required to claim a statistically significant relationship (p<.05). In other words, there is a statistically signficant relationship between political party identification, and support for affirmative action. Theses variables are not independent of one another.