Concept Mover Distance Visualizations

This section contains two types of visualizations. First, I depict the concept mover distance to the specified term over time. The visualizations are subset by UN region and a threshold line is placed at 1.5 on the y-intercept to distinguish the highly-engaged speeches. The purpose of these visualizations is to draw attention to the direction of engagement over time.

The second type of visualization depicts a regional breakdown of the highly engaged speeches. The purpose of these visualizations is to draw attention to the regional breakdown of highly engaged speeches. Since it is difficult to substantively distinguish between near-0 and negative speeches, these visualizations focus entirely on the speeches that are highly engaged with the topic at hand.

I have run many cmd tests throughout this study. Throughout each test, it appears that Latin America has been the most highly engaged and critical on most issues relating to socioeconomic inequality. Finding structural indicators of euphemization has proven difficult. For this most recent round of tests, I have shifted gears and tested concepts of concern for a group of scholars that served as the intellectual counter-movement to the NIEO. I selected this terms after reading Slobodian (2018) chapter 7.

# corporation ---- 

ungdc18$cmd_corporation <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("corporation"),wv = my.wv) %>% select(,2)
ungdc18$cmd_corporation <- unlist(ungdc18$cmd_corporation)
ungdc18$cmd_corporation <- as.numeric(ungdc18$cmd_corporation)

cmd_corporation <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_corporation, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_corporation > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'Corporation'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'Corporation'")

  propeng_corporation <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_corporation > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_corporation %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_corporation <- full_join(propeng_corporation,yeartotal)
## Joining, by = "year"
propeng_corporation <- propeng_corporation %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'Corporation'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_corporation
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_corporation

# technology transfer ---- 

ungdc18$cmd_techtrans <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("technology transfer"),wv = my.wv) %>% select(,2)
ungdc18$cmd_techtrans <- unlist(ungdc18$cmd_techtrans)
ungdc18$cmd_techtrans <- as.numeric(ungdc18$cmd_techtrans)

cmd_techtrans <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_techtrans, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_techtrans > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'techtrans'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'techtrans'")

  propeng_techtrans <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_techtrans > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_techtrans %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_techtrans <- full_join(propeng_techtrans,yeartotal)
## Joining, by = "year"
propeng_techtrans <- propeng_techtrans %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'techtrans'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_techtrans
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_techtrans

# economic equilibrium ---- 

ungdc18$cmd_econequil <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("economic equilibrium"),wv = my.wv) %>% select(,2)
ungdc18$cmd_econequil <- unlist(ungdc18$cmd_econequil)
ungdc18$cmd_econequil <- as.numeric(ungdc18$cmd_econequil)

cmd_econequil <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_econequil, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_econequil > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'econequil'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'econequil'")

  propeng_econequil <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_econequil > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_econequil %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_econequil <- full_join(propeng_econequil,yeartotal)
## Joining, by = "year"
propeng_econequil <- propeng_econequil %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'econequil'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_econequil
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_econequil

# economic growth ---- 

ungdc18$cmd_econgrow <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("economic growth"),wv = my.wv) %>% select(,2)
ungdc18$cmd_econgrow <- unlist(ungdc18$cmd_econgrow)
ungdc18$cmd_econgrow <- as.numeric(ungdc18$cmd_econgrow)

cmd_econgrow <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_econgrow, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_econgrow > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'econgrow'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'econgrow'")

  propeng_econgrow <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_econgrow > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_econgrow %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_econgrow <- full_join(propeng_econgrow,yeartotal)
## Joining, by = "year"
propeng_econgrow <- propeng_econgrow %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'econgrow'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_econgrow
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_econgrow

# invisible hand ---- 

ungdc18$cmd_invishand <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("invisible hand"),wv = my.wv) %>% select(,2)
ungdc18$cmd_invishand <- unlist(ungdc18$cmd_invishand)
ungdc18$cmd_invishand <- as.numeric(ungdc18$cmd_invishand)

cmd_invishand <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_invishand, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_invishand > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'invishand'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'invishand'")

  propeng_invishand <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_invishand > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_invishand %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_invishand <- full_join(propeng_invishand,yeartotal)
## Joining, by = "year"
propeng_invishand <- propeng_invishand %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'invishand'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_invishand
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_invishand

# hayek ---- 

ungdc18$cmd_hayek <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("hayek"),wv = my.wv) %>% select(,2)
ungdc18$cmd_hayek <- unlist(ungdc18$cmd_hayek)
ungdc18$cmd_hayek <- as.numeric(ungdc18$cmd_hayek)

cmd_hayek <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_hayek, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_hayek > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'hayek'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'hayek'")

  propeng_hayek <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_hayek > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_hayek %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_hayek <- full_join(propeng_hayek,yeartotal)
## Joining, by = "year"
propeng_hayek <- propeng_hayek %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'hayek'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_hayek
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_hayek

# obstacles to progress ---- 

ungdc18$cmd_obstprog <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("obstacles to progress"),wv = my.wv) %>% select(,2)
ungdc18$cmd_obstprog <- unlist(ungdc18$cmd_obstprog)
ungdc18$cmd_obstprog <- as.numeric(ungdc18$cmd_obstprog)

cmd_obstprog <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_obstprog, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_obstprog > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'obstprog'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'obstprog'")

  propeng_obstprog <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_obstprog > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_obstprog %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_obstprog <- full_join(propeng_obstprog,yeartotal)
## Joining, by = "year"
propeng_obstprog <- propeng_obstprog %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'obstprog'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_obstprog
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_obstprog

# creditworthy ---- 

ungdc18$cmd_creditworthy <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("creditworthy"),wv = my.wv) %>% select(,2)
ungdc18$cmd_creditworthy <- unlist(ungdc18$cmd_creditworthy)
ungdc18$cmd_creditworthy <- as.numeric(ungdc18$cmd_creditworthy)

cmd_creditworthy <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_creditworthy, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_creditworthy > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'creditworthy'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'creditworthy'")

  propeng_creditworthy <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_creditworthy > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_creditworthy %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_creditworthy <- full_join(propeng_creditworthy,yeartotal)
## Joining, by = "year"
propeng_creditworthy <- propeng_creditworthy %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'creditworthy'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_creditworthy
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_creditworthy

# trade distortion ---- 

ungdc18$cmd_tradedist <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("trade distortion"),wv = my.wv) %>% select(,2)
ungdc18$cmd_tradedist <- unlist(ungdc18$cmd_tradedist)
ungdc18$cmd_tradedist <- as.numeric(ungdc18$cmd_tradedist)

cmd_tradedist <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_tradedist, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_tradedist > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'tradedist'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'tradedist'")

  propeng_tradedist <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_tradedist > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_tradedist %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_tradedist <- full_join(propeng_tradedist,yeartotal)
## Joining, by = "year"
propeng_tradedist <- propeng_tradedist %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'tradedist'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_tradedist
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_tradedist

# trade barrier ---- 

ungdc18$cmd_tradebarr <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("trade barrier"),wv = my.wv) %>% select(,2)
ungdc18$cmd_tradebarr <- unlist(ungdc18$cmd_tradebarr)
ungdc18$cmd_tradebarr <- as.numeric(ungdc18$cmd_tradebarr)

cmd_tradebarr <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_tradebarr, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_tradebarr > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'tradebarr'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'tradebarr'")

  propeng_tradebarr <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_tradebarr > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_tradebarr %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_tradebarr <- full_join(propeng_tradebarr,yeartotal)
## Joining, by = "year"
propeng_tradebarr <- propeng_tradebarr %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'tradebarr'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_tradebarr
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_tradebarr

# welfare ---- 

ungdc18$cmd_welfare <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("welfare"),wv = my.wv) %>% select(,2)
ungdc18$cmd_welfare <- unlist(ungdc18$cmd_welfare)
ungdc18$cmd_welfare <- as.numeric(ungdc18$cmd_welfare)

cmd_welfare <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_welfare, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_welfare > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'welfare'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'welfare'")

  propeng_welfare <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_welfare > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_welfare %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_welfare <- full_join(propeng_welfare,yeartotal)
## Joining, by = "year"
propeng_welfare <- propeng_welfare %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'welfare'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_welfare
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_welfare

# welfarequeen ---- 

ungdc18$cmd_welfarequeen <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("welfare queen"),wv = my.wv) %>% select(,2)
ungdc18$cmd_welfarequeen <- unlist(ungdc18$cmd_welfarequeen)
ungdc18$cmd_welfarequeen <- as.numeric(ungdc18$cmd_welfarequeen)

cmd_welfarequeen <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_welfarequeen, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_welfarequeen > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'welfarequeen'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'welfarequeen'")

  propeng_welfarequeen <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_welfarequeen > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_welfarequeen %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_welfarequeen <- full_join(propeng_welfarequeen,yeartotal)
## Joining, by = "year"
propeng_welfarequeen <- propeng_welfarequeen %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'welfarequeen'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_welfarequeen
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_welfarequeen

# self-sufficient ---- 

ungdc18$cmd_selfsufficient <- ungdc_unnest %>% 
                    cast_dtm(term = word, 
                                document = doc_id, 
                                value = n, 
                                weighting = tm::weightTf) %>%
                            removeSparseTerms(.999) %>%
                    CMDist(cw =c("self-sufficient"),wv = my.wv) %>% select(,2)
ungdc18$cmd_selfsufficient <- unlist(ungdc18$cmd_selfsufficient)
ungdc18$cmd_selfsufficient <- as.numeric(ungdc18$cmd_selfsufficient)

cmd_selfsufficient <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
  ggplot(mapping = aes(x = year, y = cmd_selfsufficient, colour = UN_REGION)) +
  geom_point() +
  geom_text_repel(data = subset(ungdc18, cmd_selfsufficient > 3.5), aes(label = doc_id)) +
  geom_smooth() +
  geom_hline(yintercept = 1.5, linetype = "dashed") +
  labs(title = "Concept Mover Distance to 'self-sufficient'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'self-sufficient'")

  propeng_selfsufficient <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
  group_by(year, UN_REGION) %>%
  summarise(n_regionyear = n(),
            n_engage = sum(cmd_selfsufficient > 1.5))
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
yeartotal <- propeng_selfsufficient %>%
  group_by(year) %>%
  summarise(n_total = sum(n_regionyear))
## `summarise()` ungrouping output (override with `.groups` argument)
propeng_selfsufficient <- full_join(propeng_selfsufficient,yeartotal)
## Joining, by = "year"
propeng_selfsufficient <- propeng_selfsufficient %>%
  group_by(year,UN_REGION) %>%
  summarise(propeng_region = (n_engage/n_total)) %>%
  ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
  geom_area() +
  labs(title = "Proportion of Speeches Highly Engaged with 'self-sufficient'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
## `summarise()` regrouping output by 'year' (override with `.groups` argument)
cmd_selfsufficient
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

propeng_selfsufficient

# # terrorism ---- 
# 
# ungdc18$cmd_terrorism <- ungdc_unnest %>% 
#                     cast_dtm(term = word, 
#                                 document = doc_id, 
#                                 value = n, 
#                                 weighting = tm::weightTf) %>%
#                             removeSparseTerms(.999) %>%
#                     CMDist(cw =c("terrorism"),wv = my.wv) %>% select(,2)
# ungdc18$cmd_terrorism <- unlist(ungdc18$cmd_terrorism)
# ungdc18$cmd_terrorism <- as.numeric(ungdc18$cmd_terrorism)
# 
# cmd_terrorism <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
#   ggplot(mapping = aes(x = year, y = cmd_terrorism, colour = UN_REGION)) +
#   geom_point() +
#   geom_text_repel(data = subset(ungdc18, cmd_terrorism > 4.5), aes(label = doc_id)) +
#   geom_smooth() +
#   geom_hline(yintercept = 1.5, linetype = "dashed") +
#   labs(title = "Concept Mover Distance to 'terrorism'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'terrorism'")
# 
# propeng_terrorism <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
#   group_by(year, UN_REGION) %>%
#   summarise(n_regionyear = n(),
#             n_engage = sum(cmd_terrorism > 1.5))
# 
# yeartotal <- propeng_terrorism %>%
#   group_by(year) %>%
#   summarise(n_total = sum(n_regionyear))
# 
# propeng_terrorism <- full_join(propeng_terrorism,yeartotal)
# 
# propeng_terrorism <- propeng_terrorism %>%
#   group_by(year,UN_REGION) %>%
#   summarise(propeng_region = (n_engage/n_total)) %>%
#   ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
#   geom_area() +
#   labs(title = "Proportion of Speeches Highly Engaged with 'terrorism'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
# 
# cmd_terrorism
# propeng_terrorism
# 
# # security ---- 
# 
# ungdc18$cmd_security <- ungdc_unnest %>% 
#                     cast_dtm(term = word, 
#                                 document = doc_id, 
#                                 value = n, 
#                                 weighting = tm::weightTf) %>%
#                             removeSparseTerms(.999) %>%
#                     CMDist(cw =c("security"),wv = my.wv) %>% select(,2)
# ungdc18$cmd_security <- unlist(ungdc18$cmd_security)
# ungdc18$cmd_security <- as.numeric(ungdc18$cmd_security)
# 
# cmd_security <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
#   ggplot(mapping = aes(x = year, y = cmd_security, colour = UN_REGION)) +
#   geom_point() +
#   geom_text_repel(data = subset(ungdc18, cmd_security > 3.5), aes(label = doc_id)) +
#   geom_smooth() +
#   geom_hline(yintercept = 1.5, linetype = "dashed") +
#   labs(title = "Concept Mover Distance to 'security'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'security'")
# 
#   propeng_security <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
#   group_by(year, UN_REGION) %>%
#   summarise(n_regionyear = n(),
#             n_engage = sum(cmd_security > 1.5))
# 
# yeartotal <- propeng_security %>%
#   group_by(year) %>%
#   summarise(n_total = sum(n_regionyear))
# 
# propeng_security <- full_join(propeng_security,yeartotal)
# 
# propeng_security <- propeng_security %>%
#   group_by(year,UN_REGION) %>%
#   summarise(propeng_region = (n_engage/n_total)) %>%
#   ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
#   geom_area() +
#   labs(title = "Proportion of Speeches Highly Engaged with 'security'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
# 
# cmd_security
# propeng_security
# 
# # nuclearweapons ---- 
# 
# ungdc18$cmd_nuclearweapons <- ungdc_unnest %>% 
#                     cast_dtm(term = word, 
#                                 document = doc_id, 
#                                 value = n, 
#                                 weighting = tm::weightTf) %>%
#                             removeSparseTerms(.999) %>%
#                     CMDist(cw =c("nuclear weapons"),wv = my.wv) %>% select(,2)
# ungdc18$cmd_nuclearweapons <- unlist(ungdc18$cmd_nuclearweapons)
# ungdc18$cmd_nuclearweapons <- as.numeric(ungdc18$cmd_nuclearweapons)
# 
# cmd_nuclearweapons <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>%
#   ggplot(mapping = aes(x = year, y = cmd_nuclearweapons, colour = UN_REGION)) +
#   geom_point() +
#   geom_text_repel(data = subset(ungdc18, cmd_nuclearweapons > 4.5), aes(label = doc_id)) +
#   geom_smooth() +
#   geom_hline(yintercept = 1.5, linetype = "dashed") +
#   labs(title = "Concept Mover Distance to 'nuclearweapons'",subtitle = "Subset by UN Region", x = "year", y = "Conceptual Engagement with 'nuclearweapons'")
# 
# propeng_nuclearweapons <- ungdc18[ which(ungdc18$UN_REGION != "OTHER"),] %>% 
#   group_by(year, UN_REGION) %>%
#   summarise(n_regionyear = n(),
#             n_engage = sum(cmd_nuclearweapons > 1.5))
# 
# yeartotal <- propeng_nuclearweapons %>%
#   group_by(year) %>%
#   summarise(n_total = sum(n_regionyear))
# 
# propeng_nuclearweapons <- full_join(propeng_nuclearweapons,yeartotal)
# 
# propeng_nuclearweapons <- propeng_nuclearweapons %>%
#   group_by(year,UN_REGION) %>%
#   summarise(propeng_region = (n_engage/n_total)) %>%
#   ggplot(mapping = aes(x = year, y = propeng_region, fill = UN_REGION)) +
#   geom_area() +
#   labs(title = "Proportion of Speeches Highly Engaged with 'nuclearweapons'", subtitle = "Proportion Threshold at cmd > 1.5", x = "year", y = "Proportion of Highly Engaged Speeches")
# 
# cmd_nuclearweapons
# propeng_nuclearweapons