#install.packages("dplyr")
#install.packages("knitr")
#install.packages("ggplot2")
#install.packages("tidyr")
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)
voterdata <- read.csv("~/Downloads/Abbreviated Dataset Labeled(October Only)(1).csv")
voterdata%>%
group_by(PartyIdentification, gender )%>%
summarise(n=n())%>%
mutate(percent=n/sum(n))%>%
ggplot()+
geom_col(aes(gender, y=percent, fill=PartyIdentification))
Most females where not sure which party to identify with. While males mostly identified with other catagory. Overall male party affliation is spread with the leading category being other followed by Independent/Decline to State/No Party.
library(dplyr)
library(knitr)
library(ggplot2)
library(tidyr)
voterdata%>%
group_by(DeathPenalty, gender)%>%
summarise(n=n())%>%
mutate(percent=n/sum(n))%>%
ggplot()+
geom_col(aes(gender, y=percent, fill=DeathPenalty))
## Warning: Factor `DeathPenalty` contains implicit NA, consider using
## `forcats::fct_explicit_na`
## Warning: Factor `DeathPenalty` contains implicit NA, consider using
## `forcats::fct_explicit_na`
Mostly males favored the death penalty while most females were not sure about favor or not favoring death pentalty.
library(dplyr)
library(knitr)
library(ggplot2)
library(tidyr)
voterdata%>%
group_by(TaxWealthy, gender)%>%
summarise(n=n())%>%
mutate(percent=n/sum(n))%>%
ggplot()+
geom_col(aes(gender, y=percent, fill=TaxWealthy))
## Warning: Factor `TaxWealthy` contains implicit NA, consider using
## `forcats::fct_explicit_na`
## Warning: Factor `TaxWealthy` contains implicit NA, consider using
## `forcats::fct_explicit_na`
Females favored taxing the wealthy as opposed to males. Howver, the leading category had the females being unsure of favor an increase in taxes for those with incomes above $200,000. Most males opposed increasing taxes.
library(dplyr)
library(knitr)
library(ggplot2)
library(tidyr)
voterdata%>%
group_by(ImmigrantContributions, gender)%>%
summarise(n=n())%>%
mutate(percent=n/sum(n))%>%
ggplot()+
geom_col(aes(gender, y=percent, fill=ImmigrantContributions))
## Warning: Factor `ImmigrantContributions` contains implicit NA, consider
## using `forcats::fct_explicit_na`
## Warning: Factor `ImmigrantContributions` contains implicit NA, consider
## using `forcats::fct_explicit_na`
Males mostly believe, according to the data that immigrants mostly contribute to the countries resources overall. While females overall were not sure if immigrants contribute or drain the countries resources.
library(dplyr)
library(knitr)
library(ggplot2)
library(tidyr)
voterdata%>%
group_by(ImmigrantNaturalization, gender)%>%
summarise(n=n())%>%
mutate(percent=n/sum(n))%>%
ggplot()+
geom_col(aes(gender, y=percent, fill=ImmigrantNaturalization))
## Warning: Factor `ImmigrantNaturalization` contains implicit NA, consider
## using `forcats::fct_explicit_na`
## Warning: Factor `ImmigrantNaturalization` contains implicit NA, consider
## using `forcats::fct_explicit_na`
Females were not sure about providing a legal way for illegal immigrants already in the Country to become naturalized citizens while males opposed mostly providing a legal way for illegal immigrants already in the Country to become naturalized citizens.
Female Respondents according to the data studied were not sure on certain issues. They are however, least likely to favor the death penalty, uncertain of increasing taxing for those with incomes over 200,000 dollars and are indifferent regarding immigrant contribution to society.