| Title: Homework 5 |
| Author: Brandon Flores |
| Date: Sept. 29th, 2021 |
When completing this data analysis the explanatory variable was assigned to V201018; ones political party registration. The reason being for political party registration to be labeled the explanatory variable is because it proceeds before the other variable. Meaning that ones party registration may explain ones views of police treatment of blacks. Being the explanatory variable, party registration is to be observed as the independent variable of the analysis. This will be seen as the (x) variable of the analysis.
The response variable will be V202491; police treatment towards blacks. Meaning that this variable responds to the explanatory variable; being dependent of the variable. This variable will be seen as the (y) variable of the analysis.
The cross tab produced of the two variables shows V202491, ones party registration, across the columes. The column's are identified as: 1) democrats, 2) republicans, 4) none/independent, 5) other.
The variable V202491, police treatment towards blacks, is observed in the rows of the cross tab. The rows are identified as: 1) whites are treated better, 2) both the same, 3) treats blacks better.
As you observe the cross tab it is clearly to be seen of the differences between the more conservative party (republicans) compared to those more moderate to liberal parties in the cross tab.
The biggest difference is to be seen between democrats and republicans. With about 85% of democrats believing whites are treated better compared to about 37% for republicans of the same row.
Again stark contrasts can be found in row two between democrats and republicans. For the answer, treated both the same, only about 13% of democrats believe this to be true while this same view is shared by about 60% of republicans.
For column 4 (none/independent) and 5 (other) shared the most similarities among the party registrations. Whats to be shown in those similarities is that they both believe police treat whites better at about 64%. With the belief of both being treated the same for both of these parties sitting at about 34%. Because of such strong similarities there is no true statistical difference between these two parties.
Of the four different groups of political parties the two with the most differences when compared to all of the parties in the cross tab would be the democratic and republican parties. The only similarity shared between all political parties is the extremely low percentage of those who believe police treatment towards blacks is better. This give a small glimpse into the racialized history in the US. Being that from this survey it is clear that whites are treated better with only one political party (republicans) who believe they are treated the same. But it is simply out the question to believe that blacks are treated better by police.
An association can be found between these two variables. This is to be seen by observing the cross tab and analyzing that there are differences in views of treatment of police towards whites and blacks at every level of party registration. The only difference between those parties is in the percentage of attitudes observed in the rows.
To simply measure the two variables it is to be seen there is an association which is clearly represented by the cross tab. Again this is observed because of the observed differences across the rows for each column of the cross tab.
This analysis clearly draws out some of the cultural distinctions that may be present within certain political parties. These distinctions then become reflected in those candidates that are elected to represent their party.
For example, since republicans believe from this survey that police treat blacks and whites the same; the candidate they may choose might not put an emphasis on racial equality of law enforcement. Also that candidate will align with the beliefs of the party also believe that police treat both blacks and whites the same. While democrats may select candidate that believe that whites are treated better by law enforcement; reflecting the parties beliefs. Thus democratic candidates will put more emphasis on fair law enforcement of blacks while republican candidates will pay no attention to this believing there is no issue at all.
library(haven)
anes2020<-read_dta("C:\\Users\\BTP\\Downloads\\anes2020.dta")
anes2020$V201018[anes2020$V201018 <0] <- NA
anes2020$V202491[anes2020$V202491 <0] <- NA
library(janitor)
##
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
anes2020 %>%
tabyl(V201018 )
## V201018 n percent valid_percent
## 1 1861 0.224758454 0.436957032
## 2 1336 0.161352657 0.313688659
## 4 1029 0.124275362 0.241606011
## 5 33 0.003985507 0.007748298
## NA 4021 0.485628019 NA
anes2020 %>%
tabyl(V202491,V201018,show_missing_levels=F,show_na = FALSE) %>%
adorn_percentages("col") %>%
adorn_pct_formatting(digits=2) %>%
adorn_ns() %>%
knitr::kable()
| 1 |
85.65% (1427) |
37.37% (435) |
64.47% (586) |
63.33% (19) |
| 2 |
13.69% (228) |
60.82% (708) |
34.10% (310) |
33.33% (10) |
| 3 |
0.66% (11) |
1.80% (21) |
1.43% (13) |
3.33% (1) |