Homework_5v2

Refining Descriptive Stats - ATP PEW

Lenna Garibian
April 2022

Setup: Reading in SPSS (.sav) file titled “atp” and defining two new data frames, title “atp_selected” and “atp_policy” with variable needed for project.

Project Overview

The objective of this study is to understand what American’s views on democracy, and kind of role Americans want their government to have in the world.

The question is interesting in light of Russian aggression into Ukraine. Beginning in late February, 2020, America asserted its role in the international sphere around this issue, including relatively punishing economic sanctions on Russia.Recent actions in Washington seem to suggestions that both of the major political parties coalesced around these policies in support of Ukraine, signifying some level of agreement and willingness to collaborate around a shared purpose - supporting Ukrainian self determination and democracy.

A new Pew Poll (March 2022) suggests that roughly a third of Americans (32%) say that the US is providing about the right amount of support to Ukraine as it fights to hold off the Russian invasion. Another 42% say the US should be providing more support to Ukraine, while only 7% say it is providing too much support, and 19% say they are not sure.

Did this conflict unite Americans? Four months before the the Russian/Ukrainian war began, in the fall of 2021, Pew research polled Americans on the state of the US democracy, and how America should engage with the world. This analysis explores some of these questions.

Note: analysis is a WIP

American Perceptions of US Democracy

democracy <- atp_selected %>% 

select("US_Democracy") %>%
  group_by(US_Democracy) %>%
summarise(count = n()) %>% 
  mutate(percent = count/sum(count) * 100) %>%
    filter(US_Democracy%in% c("Very satisfied", "Somewhat satisfied", 
                              "Not too satisfied", "Not at all satisfied")) %>% 
  arrange(factor (US_Democracy, levels = c("Very satisfied", "Somewhat satisfied", 
                                           "Not too satisfied", "Not at all satisfied")))
  write.csv(democracy,"democracy.csv")
ggplot(democracy, aes(x = US_Democracy, y = percent, fill = percent))+
  geom_bar(stat = "identity")+
theme_bw()+

  labs(x="Satisfaction with US Democracy", y="Percentage", 
       title="Americans' Satisfaction with US Democracy", 
       caption = "Source: PEW Research 2021 ATP Database")+
      theme_linedraw() +
    theme(axis.text.x = element_text( size = 9),
          axis.text.y = element_text( size = 10),
          text = element_text(size = 11),
         legend.position="none",
          plot.caption = element_text(hjust = 0))

American Democracy as Example for Other Countries

USexample <- atp_selected %>% 

select("US_example") %>%
  group_by(US_example) %>%
summarise(count = n()) %>% 
  mutate(percent = count/sum(count) * 100) %>%
    filter(US_example %in% c("Is a good example for other countries to follow", 
                             "Used to be a good example, but has not been in recent years", 
                             "Has never been a good example for other countries to follow")) 
ggplot(USexample, aes(x=US_example, y=percent))+
geom_bar(fill = "blue4", color = "black", stat = "identity", position = position_dodge())+

  labs(x="Democracy in the US is ...", y="Percentage", 
       title="Is US democracy a good example for other countries to follow?", 
       caption = "Source: PEW Research 2021 ATP Database")+
      theme_linedraw() +
    theme(axis.text.x = element_text( size = 8, angle = 45, hjust = 1),
          
          axis.text.y = element_text( size = 9),
          text = element_text(size = 10),
          plot.caption = element_text(hjust = 0))

American Democracy as Example for Other Countries - RECODING ERROR -

Want to shorten the answer options, but its not seeing the data anymore

USexampleB <- USexample %>% 

select(US_example) %>%
  mutate(US_example = recode(US_example, "Is a good example for other countries to follow" = "Is a good example", 
                             "Used to be a good example, but has not been in recent years" = "Used to be a good example", 
                             "Has never been a good example for other countries to follow" = "Has never been a good example")) %>% 
  group_by(US_example) %>%
summarise(count = n()) %>% 
  mutate(percent = count/sum(count) * 100) %>%
    filter(US_example %in% c("Is a good example", "Used to be a good example", "Has never been a good example")) 
ggplot(USexampleB, aes(x = US_example, y = percent, fill = percent))+
  geom_bar(stat = "identity")+
theme_bw()+

  labs(x="Democracy in the US is ...", y="Percentage", 
       title="Is US democracy a good example for other countries to follow?", 
       caption = "Source: PEW Research 2021 ATP Database")+
      theme_linedraw() +
    theme(axis.text.x = element_text( size = 8, angle = 45, hjust = 1),
          
          axis.text.y = element_text( size = 9),
          text = element_text(size = 10),
          plot.caption = element_text(hjust = 0))

US Role in World Leadership, by Political Orientation

USLeadership <- atp_selected %>% 

select(c(US_leadership,F_PARTYSUMIDEO))  %>%

  group_by(US_leadership,F_PARTYSUMIDEO) %>%
summarise(count = n()) %>% 
  mutate(percent = count/sum(count) * 100) %>%
filter(US_leadership %in%c ("Be the single world leader","Play a shared leadership role",
                            "Not play any leadership role")) %>%
      filter(F_PARTYSUMIDEO %in% c("Liberal Dem/Lean","Conservative Rep/Lean"))
write.csv(USLeadership,"USLeadership.csv")
ggplot(USLeadership, aes(x=US_leadership, y=percent, fill=F_PARTYSUMIDEO))+
  geom_bar(stat = "identity", position = position_dodge())+
  labs(x="The US should ...", y="Percentage", title = "What kind of role should the US play in world leadership?")+
  theme_classic()

US Role in World Leadership, by political orientation w/facet wrap -

 ggplot(USLeadership, aes(x = US_leadership, y = percent, fill = F_PARTYSUMIDEO))+
  geom_bar(stat = "identity")+
  facet_wrap(~F_PARTYSUMIDEO)+

 theme_bw()+
    labs(x="The US should ...", y="Percentage", 
       title="What kind of role should the US play in world leadership?", 
       caption = "Source: PEW Research 2021 ATP Database")

Americans’ Confidence in World Leaders

Leadership <- atp_selected %>% select(US_Biden_Confidence, 
                                      Chinese_Jinping_Confidence, Russian_Putin_Confidence, 
                                      German_Merkel_Confidence, French_Macron_Confidence) 

Leadership <- pivot_longer(Leadership, cols=c("US_Biden_Confidence", 
                            "Chinese_Jinping_Confidence", "Russian_Putin_Confidence", 
                            "German_Merkel_Confidence", "French_Macron_Confidence"), 
                           names_to = "World_leaders", values_to = "Level") 
Leadership <- Leadership %>% 

  group_by(`World_leaders`, Level) %>% 
  summarise(Freq = n()) %>% 
 
  mutate(percentage = formattable::percent(Freq / sum(Freq)))
head(Leadership)
# A tibble: 6 Ă— 4
# Groups:   World_leaders [2]
  World_leaders              Level                    Freq percentage
  <chr>                      <fct>                   <int> <formttbl>
1 Chinese_Jinping_Confidence A lot of confidence        29 1.12%     
2 Chinese_Jinping_Confidence Some confidence           296 11.40%    
3 Chinese_Jinping_Confidence Not too much confidence  1043 40.18%    
4 Chinese_Jinping_Confidence No confidence at all     1170 45.07%    
5 Chinese_Jinping_Confidence Refused                    58 2.23%     
6 French_Macron_Confidence   A lot of confidence       259 9.98%     
ggplot(Leadership, aes(x=percentage, y=World_leaders, fill=Level))+
geom_bar(stat = "identity", position = position_dodge())+

  labs(x="Confidence Level", y="World Leaders", 
       title="Americans' Confidence in World Leaders", 
       caption = "Source: PEW Research 2021 ATP Database")+
  theme_classic()

Perceptions Around Collaborating with Other Countries to Solve Problems

US_cooperation_polit_lean <- atp_selected %>% 
    rename(Political_Orientation = F_PARTYSUMIDEO) %>% 
  select(Intl_Collaboration, Political_Orientation) %>% 
  mutate(Intl_Collaboration = recode(Intl_Collaboration, "MANY of the problems facing our country can be solved by working with other countries" = "MANY problems ...", "FEW of the problems facing our country can be solved by working with other countries" = "FEW problems ...")) %>% 
  filter(Intl_Collaboration %in% c("MANY problems ...","FEW problems ...")) %>% 
  group_by(Intl_Collaboration, Political_Orientation)%>% 
summarise(freq = n()) %>% 
    mutate(percentage = formattable::percent(freq / sum(freq))) %>% 
  filter(Political_Orientation %in% c("Liberal Dem/Lean", "Moderate/Conservative Dem/Lean", 
                                      "Moderate/Liberal Rep/Lean", "Conservative Rep/Lean")) 
head(US_cooperation_polit_lean)
# A tibble: 6 Ă— 4
# Groups:   Intl_Collaboration [2]
  Intl_Collaboration Political_Orientation           freq percentage
  <fct>              <fct>                          <int> <formttbl>
1 MANY problems ...  Conservative Rep/Lean            188 13.19%    
2 MANY problems ...  Moderate/Liberal Rep/Lean        156 10.95%    
3 MANY problems ...  Moderate/Conservative Dem/Lean   483 33.89%    
4 MANY problems ...  Liberal Dem/Lean                 543 38.11%    
5 FEW problems ...   Conservative Rep/Lean            501 43.95%    
6 FEW problems ...   Moderate/Liberal Rep/Lean        234 20.53%    
ggplot(US_cooperation_polit_lean, aes(x=Intl_Collaboration, y=percentage, fill=Political_Orientation))+
  geom_bar(stat = "identity", position = position_dodge())+
  labs(x="Collaborative Approach", y="Level", title = "How many problems facing the US can be solved by working with other countries?")+
  theme_classic()

Americans’ Top Policy Priorities - at home and abroad

atp_policy <- atp_policy %>%
select(c(1:21))

atp_policy <- pivot_longer(atp_policy, cols = c(Reduce_WeaponsMD,American_Jobs,Strengthen_UN,
                                    Reduce_USMil_Overseas, Limit_Russia_Power, Promote_Democracy_Overseas,
                                    Reduce_Illegal_Immigr, Limit_China_Power, Maintain_USMil_Advantage,
                                    Global_Climate_Change, Reduce_Trade_Deficit, Promote_Human_Rights, 
                                    Reduce_Inf_Diseases,Limit_Iran_Power, Improve_Relations_Allies, 
                                    Protect_US_From_Terror, Better_Share_Cost_World_Order, 
                                    Aide_Refugees_from_Violence, Reduce_Legal_Immigr_to_US,
                                    Reduce_Legal_Immigr_to_US, Limit_NKorea_Power), 
                                    names_to = "Policy-goals", values_to ="Level") %>% 

  group_by(`Policy-goals`,`Political_Orientation`, `Level`) %>%
    filter(Political_Orientation %in% c("Liberal Dem/Lean","Conservative Rep/Lean")) %>%
 filter(Level%in% c("Top priority")) %>% 
  summarise(freq = n())  %>% 
  ungroup() %>% 
    mutate(percentage = formattable::percent(freq / sum(freq)))
head(atp_policy)
# A tibble: 6 Ă— 5
  `Policy-goals`               Political_Orien… Level  freq percentage
  <chr>                        <fct>            <fct> <int> <formttbl>
1 Aide_Refugees_from_Violence  Conservative Re… Top …    25 0.40%     
2 Aide_Refugees_from_Violence  Liberal Dem/Lean Top …   166 2.65%     
3 American_Jobs                Conservative Re… Top …   326 5.20%     
4 American_Jobs                Liberal Dem/Lean Top …   199 3.17%     
5 Better_Share_Cost_World_Ord… Conservative Re… Top …   218 3.47%     
6 Better_Share_Cost_World_Ord… Liberal Dem/Lean Top …    82 1.31%     

Americans’ Top Policy Priorities - at home and abroad (new)

atp_policy %>% 
  
  ggplot(aes(x=`percentage`, y=`Policy-goals`, fill=Political_Orientation)) + 
  geom_bar(stat = "identity", position = "dodge")+
 theme_bw()+
    labs(x="Percentage", y="US Policy Goals", 
         title = "Top US Policy Priorities, by Politital Orientation")+
  theme(legend.position = "bottom")+
  theme(panel.grid = element_blank(), 
            axis.text = element_text(size = 10), 
            axis.title = element_text(size = 11), 
            plot.title = element_text(size = 11, hjust = 0.5, face = "bold"))

Summary (WIP)

The objective of this study is to understand what American’s views on democracy, and kind of role Americans want their government to have in the world.

A new Pew Poll (March 2022) suggests that roughly a third of Americans (32%) say that the US is providing about the right amount of support to Ukraine as it fights to hold off the Russian invasion. Another 42% say the US should be providing more support to Ukraine, while only 7% say it is providing too much support, and 19% say they are not sure.

New poll also suggests…..you gotta work faster!! :)

Did this conflict unite Americans? Four months before the the Russian/Ukrainian war began, in the fall of 2021, Pew research polled Americans on the state of the US democracy, and how America should engage with the world. This analysis explores some of these questions.

About the data: Wave 82 American Trends Panel conducted by PEW RESEARCH CENTER via Web, among 2,596 English- and Spanish-speaking Americans, February 1-7, 2021.

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

Garibian (2022, April 6). Data Analytics and Computational Social Science: Homework_5v2. Retrieved from https://github.com/DACSS/dacss_course_website/posts/httpsrpubscomlenna717887249/

BibTeX citation

@misc{garibian2022homework_5v2,
  author = {Garibian, Lenna},
  title = {Data Analytics and Computational Social Science: Homework_5v2},
  url = {https://github.com/DACSS/dacss_course_website/posts/httpsrpubscomlenna717887249/},
  year = {2022}
}