Assignment Overview

I am interested in how those who graduated high school only versus those who graduated college (4 year institutions) (educ_2019) feel about women and their role in society. I will be analyzing the following variables:

  • Feeling towards women on a scale from 1-100 (Women_2019)
  • Gender equality issue importance (imiss_y_2019)
  • Gender roles (sexism1_2019)
    • Women should return to their traditional roles in society
  • Modern sexism demands (sexism2_2019)
    • Women often miss out on good jobs because of discrimination

Importing the data

library(dplyr)
## Warning: package 'dplyr' was built under R version 3.6.2
## 
## 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(readr)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.6.2
data<-read_csv("/Users/rebeccagibble/Downloads/Voter Data 2019 (1).csv")
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   weight_18_24_2018 = col_logical(),
##   izip_2019 = col_character(),
##   housevote_other_2019 = col_character(),
##   senatevote_other_2019 = col_character(),
##   senatevote2_other_2019 = col_character(),
##   SenCand1Name_2019 = col_character(),
##   SenCand1Party_2019 = col_character(),
##   SenCand2Name_2019 = col_character(),
##   SenCand2Party_2019 = col_character(),
##   SenCand3Name_2019 = col_character(),
##   SenCand3Party_2019 = col_character(),
##   SenCand1Name2_2019 = col_character(),
##   SenCand1Party2_2019 = col_character(),
##   SenCand2Name2_2019 = col_character(),
##   SenCand2Party2_2019 = col_character(),
##   SenCand3Name2_2019 = col_character(),
##   SenCand3Party2_2019 = col_character(),
##   governorvote_other_2019 = col_character(),
##   GovCand1Name_2019 = col_character(),
##   GovCand1Party_2019 = col_character()
##   # ... with 108 more columns
## )
## See spec(...) for full column specifications.
## Warning: 800 parsing failures.
##  row               col           expected           actual                                                     file
## 2033 weight_18_24_2018 1/0/T/F/TRUE/FALSE .917710168467982 '/Users/rebeccagibble/Downloads/Voter Data 2019 (1).csv'
## 2828 weight_18_24_2018 1/0/T/F/TRUE/FALSE 1.41022291345592 '/Users/rebeccagibble/Downloads/Voter Data 2019 (1).csv'
## 4511 weight_18_24_2018 1/0/T/F/TRUE/FALSE 1.77501243840922 '/Users/rebeccagibble/Downloads/Voter Data 2019 (1).csv'
## 7264 weight_18_24_2018 1/0/T/F/TRUE/FALSE 1.29486870319614 '/Users/rebeccagibble/Downloads/Voter Data 2019 (1).csv'
## 7277 weight_18_24_2018 1/0/T/F/TRUE/FALSE 1.44972719707603 '/Users/rebeccagibble/Downloads/Voter Data 2019 (1).csv'
## .... ................. .................. ................ ........................................................
## See problems(...) for more details.

Recoding and selecting variables

Recoding variables from numeric form to their labeled form.

Selecting only necessary variables

newdata<-data%>%
  mutate(GenderEquality = ifelse(imiss_y_2019==1,"Very Important",
                                 ifelse(imiss_y_2019==2,"Somewhat Important",
                                        ifelse(imiss_y_2019==3, "Not very Important",
                                               ifelse(imiss_y_2019==4, "Unimportant", NA)))),
          GenderRoles = ifelse(sexism1_2019==1, "Strongly Agree",
                              ifelse(sexism1_2019==2, "Somewhat Agee",
                                     ifelse(sexism1_2019==3, "Somewhat Disagree",
                                            ifelse(sexism1_2019==4, "Strongly Disagree",NA)))),
         ModernSexism = ifelse(sexism2_2019==1, "Strongly Agree",
                               ifelse(sexism2_2019==2, "Somewhat Agree",
                                      ifelse(sexism2_2019==3, "Somewhat Disagree",
                                             ifelse(sexism2_2019==4, "Strongly Disagree",NA)))),
         FeelingAboutWomen = ifelse(Women_2019>100,NA, Women_2019))%>%
  select(GenderEquality,GenderRoles,ModernSexism,FeelingAboutWomen,educ_2019)

Filtering Data

Filtering data to only select two groups needed for analysis.

Previewing data to confirm changes.

newdata2<-newdata%>%
  filter(educ_2019 %in% c("2","5"))%>%
  mutate(EducationLevel = ifelse(educ_2019==2, "High school graduate",
                                 ifelse(educ_2019==5, "College graduate",NA)))%>%
  select(GenderEquality,GenderRoles,ModernSexism,FeelingAboutWomen,EducationLevel)

head(newdata2)
## # A tibble: 6 x 5
##   GenderEquality   GenderRoles   ModernSexism   FeelingAboutWom… EducationLevel 
##   <chr>            <chr>         <chr>                     <dbl> <chr>          
## 1 Very Important   Strongly Dis… Strongly Disa…               80 College gradua…
## 2 Very Important   Strongly Dis… Somewhat Disa…               71 High school gr…
## 3 Somewhat Import… Strongly Dis… Somewhat Disa…               95 College gradua…
## 4 Very Important   Strongly Dis… Strongly Disa…               99 College gradua…
## 5 Very Important   Strongly Dis… Strongly Disa…               82 College gradua…
## 6 Very Important   Strongly Dis… Strongly Disa…               99 College gradua…