Data Preparation
VoterData_Original<-VoterData_Original%>%
mutate(race = ifelse(race_2019==1,"White",
ifelse(race_2019==2,"Black",
ifelse(race_2019==3,"Hispanic",
ifelse(race_2019==4,"Asian",
ifelse(race_2019==5,"Native American",
ifelse(race_2019==6,"Mixed",
ifelse(race_2019==7,"Other",
ifelse(race_2019==8,"Middle Eastern", NA)))))))))
VoterData_Original<-VoterData_Original%>%
mutate(univhealthcarecov_2019=ifelse(univhealthcov_2019==1,"Yes",
ifelse(univhealthcov_2019==2,"No",
ifelse(univhealthcov_2019==8,"Don't Know",NA))))
VoterData_Original<-VoterData_Original%>%
mutate(healthreform_2019=ifelse(healthreformbill_2019==1,"Expanded",
ifelse(healthreformbill_2019==2,"Kept the same",
ifelse(healthreformbill_2019==3,"Repealed",
ifelse(healthreformbill_2019==8,"Don't Know",NA)))))
VoterData_Original<-VoterData_Original%>%
mutate(favorhealthcarelaw_2019=ifelse(favorhealth_2019==1,"Strongly Favor",
ifelse(favorhealth_2019==2,"Somewhat Favor", ifelse(favorhealth_2019==3,"Somewhat Oppose",
ifelse(favorhealth_2019==4,"Strongly Oppose",
ifelse(favorhealth_2019==8,"Don't Know",NA))))))
VoterData_Original<-VoterData_Original%>%
mutate(immi_difficult_2019=ifelse(immi_makedifficult_2019==1,"Much Easier",
ifelse(immi_makedifficult_2019==2,"Slightly Easier",
ifelse(immi_makedifficult_2019==3,"No Change",
ifelse(immi_makedifficult_2019==4,"Slightly Harder",
ifelse(immi_makedifficult_2019==5,"Much Harder", ifelse(immi_makedifficult_2019==8, "Don't Know",NA)))))))
VoterData_Original<-VoterData_Original%>%
mutate(favordreamer_2019=ifelse(immi_stay_2019==1,"Strongly Favor",
ifelse(immi_stay_2019==2,"Somewhat Favor", ifelse(immi_stay_2019==3,"Somewhat Oppose",
ifelse(immi_stay_2019==4,"Strongly Oppose",
ifelse(immi_stay_2019==8,"Don't Know",NA))))))
VoterData_Original<-VoterData_Original%>%
mutate(immi_separate_2019=ifelse(immi_sepa_2019==1,"Strongly Agree",
ifelse(immi_sepa_2019==2,"Somewhat Agree", ifelse(immi_sepa_2019==3,"Somewhat Disagree",
ifelse(immi_sepa_2019==4,"Strongly Disagree",
ifelse(immi_sepa_2019==8,"Don't Know",NA))))))
NewVoterData<-VoterData_Original%>%
filter(race %in% c("White", "Asian"))%>%
select(race, univhealthcarecov_2019, healthreform_2019, favorhealthcarelaw_2019, immi_difficult_2019, favordreamer_2019,immi_separate_2019, Democrats_2019, Republicans_2019)
Data Exploration
Comparing White and Asian Respondents on Their Opinions about the Federal Government’s Role in the Country’s Health Care System
NewVoterData <- NewVoterData%>%
mutate(univhealthcarecov_2019 = factor(univhealthcarecov_2019, levels=c("Yes", "No", "Don't Know")))
prop.table(table(NewVoterData$univhealthcarecov_2019, NewVoterData$race),2)
##
## Asian White
## Yes 0.65644172 0.45263158
## No 0.24539877 0.47169811
## Don't Know 0.09815951 0.07567031
Based on the table generated above, the majority of Asian respondents (about 66%) think that the federal government is obligated to see that everyone has health insurance. However, among the white respondents, there are slightly more people who think it is not the federal government’s responsibility to see that everyone receives health care coverage (45% said yes and 47% said no).
Comparing White and Asian Respondents on Their Opinions about the Federal Government’s Role in the Country’s Health Care System (Visualization)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.6.3
NewVoterData%>%
group_by(race, univhealthcarecov_2019)%>%
summarize(n=n())%>%
mutate(percent=n/sum(n))%>%
ggplot()+
geom_col(aes(x=race, y=percent, fill=univhealthcarecov_2019))
## Warning: Factor `univhealthcarecov_2019` contains implicit NA, consider using
## `forcats::fct_explicit_na`

Based on the stacked column chart generated above, there is a significant difference between Asian and white respondents’ opinions about the role of the federal government in the nation’s health care system. The majority of Asian respondents think the federal government has the responsibility to see that everyone has health insurance in the country. However, about the half of the white respondents think that it is not the responsibility for the federal government to see if everyone has health insurance.
Comparing White and Asian Respondents on Their Opinions about the Affordable Care Act
NewVoterData <- NewVoterData%>%
mutate(favorhealthcarelaw_2019 = factor(favorhealthcarelaw_2019, levels=c("Strongly Favor", "Somewhat Favor", "Somewhat Oppose", "Strongly Oppose", "Don't Know")))
prop.table(table(NewVoterData$favorhealthcarelaw_2019, NewVoterData$race),2)
##
## Asian White
## Strongly Favor 0.36503067 0.28432347
## Somewhat Favor 0.25460123 0.17027618
## Somewhat Oppose 0.09509202 0.15358633
## Strongly Oppose 0.14417178 0.31492152
## Don't Know 0.14110429 0.07689251
Based on the table above, the majority of Asian respondents (about 62%) favor the provision of the Affordable Care Act that all Americans must have health insurance or they pay a fine. On the other hand, there is no significant difference between the percentages of people who favor and oppose the provision of the law among the white respondents. (about 45% favor it and 46% oppose it)
Comparing White and Asian Respondents on Their Opinions about the Hardness for Foreigners to Immigrate to United States
NewVoterData <- NewVoterData%>%
mutate(immi_difficult_2019 = factor(immi_difficult_2019, levels=c("Much Easier", "Slightly Easier", "No Change", "Slightly Harder", "Much Harder", "Don't Know")))
prop.table(table(NewVoterData$immi_difficult_2019, NewVoterData$race),2)
##
## Asian White
## Much Easier 0.15030675 0.12584359
## Slightly Easier 0.19325153 0.20226280
## No Change 0.26687117 0.23878523
## Slightly Harder 0.16564417 0.15958714
## Much Harder 0.14110429 0.22350139
## Don't Know 0.08282209 0.05001985
Based on the table above, there are more white respondents (about 38%) who believe that it should be harder for foreigners to come to live in the United States than Asian respondents (about 31%).
Comparing White and Asian Respondents on How They Perceive Dreamers
NewVoterData <- NewVoterData%>%
mutate(favordreamer_2019 = factor(favordreamer_2019, levels=c("Strongly Favor", "Somewhat Favor", "Somewhat Oppose", "Strongly Oppose", "Don't Know")))
prop.table(table(NewVoterData$favordreamer_2019, NewVoterData$race),2)
##
## Asian White
## Strongly Favor 0.43558282 0.36938370
## Somewhat Favor 0.23312883 0.25208748
## Somewhat Oppose 0.13190184 0.16799205
## Strongly Oppose 0.09815951 0.15089463
## Don't Know 0.10122699 0.05964215
Based on the sum of the percentage for “Strongly Favor” and “Somewhat Favor” for each group of respondents, there are slighly more Asian respondents (about 67%) who favor the young adults who were brought to the United States illegally as children to stay and live here legally than white respodents (about 62%).
Comparing White and Asian Respondents on Their Beliefs about Separating Undocumented Immigrant Families
NewVoterData <- NewVoterData%>%
mutate(immi_separate_2019 = factor(immi_separate_2019, levels=c("Strongly Agree", "Somewhat Agree", "Somewhat Disagree", "Strongly Disagree", "Don't Know")))
prop.table(table(NewVoterData$immi_separate_2019, NewVoterData$race),2)
##
## Asian White
## Strongly Agree 0.13888889 0.18639348
## Somewhat Agree 0.13580247 0.15436642
## Somewhat Disagree 0.13888889 0.10980704
## Strongly Disagree 0.48456790 0.47145415
## Don't Know 0.10185185 0.07797891
Based on the table above, most of white (about 47%) and Asian (about 48%) respondents strong disagree with the statement, " It is appropriate to separate undocumented immigrant parents from their children when they cross the border in order to discourage others from crossing the border illegally." This result implies that most white and Asian respondents believe children of undocumented immigrants should not be separated from their parents.
Comparing White and Asian Respondents on Their Feelings Towards Democrats
NewVoterData%>%
group_by(race)%>%
filter(Democrats_2019<=100)%>%
summarize(avgft_democrats=mean(Democrats_2019, na.rm=TRUE))
## # A tibble: 2 x 2
## race avgft_democrats
## <chr> <dbl>
## 1 Asian 59.6
## 2 White 42.7
Based on the table above, the average feeling towards democrats for Asian respondents is higher than the average feeling towards democratss for white respondents (59.64 > 42.67191). This implies that in general, Asian respondents provided higher values for their feelings towards democrats.
Comparing White and Asian Respondents on Their Feelings Towards Democrats (Visualization)
NewVoterData%>%
filter(Democrats_2019<=100)%>%
ggplot()+geom_histogram(aes(x=Democrats_2019))+
facet_wrap(~race)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Based on the histograms above, most of Asian respondents gave more than 50 for their feeling towards democrats. On the other hand, there are more people among white respondents who gave the values less than 50. This finding follows why the value of the average feeling towards democrats for Asian respondents is much higher than that of white respondents. (The frequency for the values for Asian respondents are much lower compare to that of white respondents due to the total number of Asian respondents, which are 326)
Comparing White and Asian Respondents on Their Feelings Towards Republicans
NewVoterData%>%
group_by(race)%>%
filter(Republicans_2019<=100)%>%
summarize(avgft_republicans=mean(Republicans_2019, na.rm=TRUE))
## # A tibble: 2 x 2
## race avgft_republicans
## <chr> <dbl>
## 1 Asian 36.2
## 2 White 43.3
Based on the table above, the average feeling towards republicans for white respondents is higher than the average feeling towards republicans for Asian respondents (43.29245 > 36.19776). This implies that in general, white respondents provided higher values for their feelings towards republicans.