Homework 5

DACSS-601

Katie Popiela
4/27/2022
library(tidyverse)
library(dplyr)
library(poliscidata)
gss %>%
  select(sex,polviews,degree) %>%
  head(25) %>%
  tibble()
# A tibble: 25 x 3
   sex    polviews  degree      
   <fct>  <fct>     <fct>       
 1 Male   Moderate  Bachelor deg
 2 Male   SlghtCons HS          
 3 Male   SlghtCons HS          
 4 Female SlghtCons HS          
 5 Female Liberal   Bachelor deg
 6 Female Moderate  Bachelor deg
 7 Female Moderate  Junior Coll 
 8 Female Moderate  <HS         
 9 Female Conserv   <HS         
10 Female Liberal   Bachelor deg
# ... with 15 more rows

I included the following graph in HW4, so I’m doing a facet wrap with it in an attempt to either tidy it up by majority or just make the existing graph easier to read.

library(poliscidata)
data(gss)
gss_refined<-gss %>%
  select(polviews,sex,degree)
summary(gss_refined)
      polviews       sex                degree   
 Moderate :713   Male  : 886   <HS         :288  
 Conserv  :292   Female:1088   HS          :976  
 SlghtCons:268                 Junior Coll :151  
 Liberal  :244                 Bachelor deg:354  
 SlghtLib :208                 Graduate deg:205  
 (Other)  :149                                   
 NA's     :100                                   
library(poliscidata)
ggplot(gss_refined) + geom_point(aes(x=degree, y=polviews,color=sex)) +
  labs(x="Highest Degree Awarded",y="Political Views") +
  facet_grid()

data(gss)
ggplot(gss_refined) + geom_jitter(aes(x=degree, y=polviews,color=sex)) +
  labs(x="Highest Degree Awarded",y="Political Views") +
  facet_grid()

Note: I think the above graph is the best one this far, but I’m going to try to tweak it to make it a little more precise

gss_refined%>%
  pairs()

1. I don’t think anything is missing from my analysis, I’m just trying to see if there’s a better way to visualize everything. There may not be a better way, but I’m going to use these homeworks to keep trying!

2. I have to do some more analysis, but right now, I can at least draw the conclusion that there is a very significant majority (or concentration of respondents) who have a high school diploma and hold moderate political views.

3. A reader without any context would at the very least need some understanding of the current political trends in the US (e.g. the rise of conservatism and the rise of far-left socialism among Gen Z/younger generations).

4. I’d like to incorporate how age plays a part in all this but I couldn’t figure out how to graph 4 different variables.

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Popiela (2022, April 27). Data Analytics and Computational Social Science: Homework 5. Retrieved from https://github.com/DACSS/dacss_course_website/posts/httprpubscomkpopiela895215/

BibTeX citation

@misc{popiela2022homework,
  author = {Popiela, Katie},
  title = {Data Analytics and Computational Social Science: Homework 5},
  url = {https://github.com/DACSS/dacss_course_website/posts/httprpubscomkpopiela895215/},
  year = {2022}
}