#install.packages("dplyr")
#install.packages("knitr")
#install.packages("ggplot2")
#install.packages("tidyr")
#install.packages("readr")
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
library(knitr)
library(ggplot2)
library(tidyr)
library(readr)
voterdata<- read_csv("/Users/phoebeleslie/Downloads/Abbreviated Dataset Labeled(October Only)V2.csv")
## Parsed with column specification:
## cols(
## .default = col_character(),
## NumChildren = col_double(),
## ft_fem_2017 = col_double(),
## ft_immig_2017 = col_double(),
## ft_police_2017 = col_double(),
## ft_dem_2017 = col_double(),
## ft_rep_2017 = col_double(),
## ft_evang_2017 = col_double(),
## ft_muslim_2017 = col_double(),
## ft_jew_2017 = col_double(),
## ft_christ_2017 = col_double(),
## ft_gays_2017 = col_double(),
## ft_unions_2017 = col_double(),
## ft_altright_2017 = col_double(),
## ft_black_2017 = col_double(),
## ft_white_2017 = col_double(),
## ft_hisp_2017 = col_double()
## )
## See spec(...) for full column specifications.
voterdata%>%
filter(!is.na(PartyIdentification))%>%
mutate(PartyIdentification = factor(PartyIdentification, levels = c("Democrat", "Republican", "Independent", "Other", "Not Sure")))%>%
group_by(PartyIdentification)%>%
#summarise(avg_ft_immig = mean(ft_immig_2017, na.rm = TRUE))%>%
filter(!is.na(ft_immig_2017))%>%
ggplot()+
geom_histogram(aes(x=ft_immig_2017, fill=PartyIdentification))+
facet_wrap(~PartyIdentification)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Democrats have positive feelings towards immigration based on the mean of 70. Republicans with a mean of 52 have neutral feelings while the independent and other categorys are in the lower end of the specturm waivering around being slightly positive towards immigrations with mean scores of 61 and 59 respectively. Those not sure of party identification have a mean score of 48 which falls below the neutual feelings mark of 50. The histogram showing distribution shows the democrats to be positively skewed. While Republican and independent waiver around nuetral mosly.
voterdata%>%
filter(!is.na(PartyIdentification))%>%
mutate(PartyIdentification = factor(PartyIdentification, levels = c("Democrat", "Republican", "Independent","Other", "Not Sure")))%>%
group_by(PartyIdentification)%>%
#summarise(avg_ft_gays = mean(ft_gays_2017, na.rm = TRUE))%>%
filter(!is.na(ft_gays_2017))%>%
ggplot()+
geom_histogram(aes(x=ft_gays_2017, fill=PartyIdentification))+
facet_wrap(~PartyIdentification)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Democrats have positive feelings towards the LGBTQ based on the mean of 73. Republicans with a mean of 45 waiver between having negative feelings or neutrality. While the independent category is in the lower end waivering around being slightly positive towards LGBTQ with mean scores of 60. Other and not sure categories are neutral with their feeling towards LGBTQ with a matching mean of 55. The histogram showing distribution shows the democrats to be positively skewed. While Republican and independent waiver around nuetral mosly.
voterdata%>%
filter(!is.na(PartyIdentification))%>%
mutate(PartyIdentification = factor(PartyIdentification, levels = c("Democrat", "Republican", "Independent","Other", "Not Sure")))%>%
group_by(PartyIdentification)%>%
#summarise(avg_ft_labor = mean(ft_unions_2017, na.rm = TRUE))%>%
filter(!is.na(ft_unions_2017))%>%
ggplot()+
geom_histogram(aes(x=ft_unions_2017, fill=PartyIdentification))+
facet_wrap(~PartyIdentification)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Democrats have positive feelings towards labor unions based on the mean of 72. Republicans with a mean of 32 scews towards having negative feelings. While the independent category with a mean of 49.8 is nuetral towards labor unions. Other category with a mean score of 41 is scewed towards negative feelings towards labor unions and not sure category is neutral with their feeling towards labor unions with a mean of 52.The histogram showing distribution shows the democrats to be positively skewed. While Republican are negatively skewed and independent waiver around nuetral mosly.