Plotting Attitudes Towards EU Integration in Four European Countries

Why post on Github when you can post on your blog, right? Well, I’ve been wanting to start publishing articles on my website for a while as it’s been empty since I created it a couple of months ago.

I’m studying views on EU integration for one of my assignments and I decided to post the plots that I made today (there will probably be more to come). I’m using data from the European Social Survey (Round 9). In this first post, I won’t be running any inferential statistical tests. I just wanted to plot some variables to see if there’s anything interesting going on. My main dependent variable is euftf. Respondents were asked whether they think that EU integration should remain as it is or go further and responses were coded on a scale of 1 to 10. I’m using RStudio and the Tidyverse package available in the CRAN library. I’m also using socsci, a package developed by one of my professors at EIU (available here).

EU Integration and Political Ideology

I calculated the means for each country separately (represented by the vlines and the hlines).

test <- test %>% 
  mutate(country = frcode(cntry == "FR" ~ "France", 
                          cntry == "ES" ~ "Spain", 
                          cntry == "DE" ~ "Germany", 
                          cntry == "IT" ~ "Italy", 
                          TRUE ~ "REMOVE"))


test %>% 
  ggplot(., aes(x= lrscale, y = euftf, col = country)) + 
  geom_jitter(alpha = .05) + 
  scale_x_continuous(limits = c(0, 10)) + 
  theme_minimal() + 
  theme(text=element_text(size = 22, family="saira")) +
  theme(legend.position = "none") + 
  labs(x = "<-- Leaning Left | Leaning Right -->", y = "- Attitudes Toward EU Integration +", title = "Political Ideology & Attitudes Toward EU Integration", caption = "@JihedNcib | Data: ESS 2018") +
  geom_vline(data=filter(test, cntry=="FR"), aes(xintercept=4.88), linetype = "dashed") +
  geom_vline(data=filter(test, cntry=="IT"), aes(xintercept=5.26), linetype = "dashed") +
  geom_vline(data=filter(test, cntry=="DE"), aes(xintercept=4.39), linetype = "dashed") +
  geom_vline(data=filter(test, cntry=="ES"), aes(xintercept=4.43), linetype = "dashed") +
  geom_hline(data=filter(test, cntry=="FR"), aes(yintercept=5.30), linetype = "dashed") +
  geom_hline(data=filter(test, cntry=="IT"), aes(yintercept=4.86), linetype = "dashed") +
  geom_hline(data=filter(test, cntry=="DE"), aes(yintercept=6.26), linetype = "dashed") +
  geom_hline(data=filter(test, cntry=="ES"), aes(yintercept=6.22), linetype = "dashed") +
  facet_wrap(~country)

EU Integration and Attachment to One’s Country

ggg <- allattach %>% 
  group_by(cntry, atchctr) %>% 
  mean_ci(euftf)

ggg <- ggg %>% 
  mutate(country = frcode(cntry == "FR" ~ "France", 
                          cntry == "ES" ~ "Spain", 
                          cntry == "DE" ~ "Germany", 
                          TRUE ~ "REMOVE"))
ggg %>% 
  ggplot(., aes(x= atchctr, y = mean, group = country, color = country)) +
  geom_line(size = 1) +
  theme_minimal() +
  theme(text=element_text(size=22, family="saira")) +
  scale_y_continuous(limits = c(0, 10)) +
  scale_color_manual(values=c("dodgerblue3", "firebrick1", "forestgreen")) +
  scale_fill_manual(values=c("dodgerblue3", "firebrick1", "forestgreen")) +
  labs(x ="- Emotional National Attachment +", y = "- Attitudes Toward EU Integration +", subtitle = "", title = "Emotional National Attachment & Attitudes Toward EU Integration", caption = "@JihedNcib | Data: ESS 2018") +
  theme(legend.position = c(0.8, 0.1)) +
  theme(legend.title=element_blank())

EU Integration and Level of Education

all <- rbind(fr,es,de,it)
alledu<- all %>% select(eduyrs, cntry, euftf)


graph <- alledu %>% group_by(cntry, eduyrs) %>% mean_ci(euftf)
graph<- graph %>% filter(eduyrs <= 30)


graph <- graph %>% 
  mutate(country = frcode(cntry == "FR" ~ "France", 
                          cntry == "ES" ~ "Spain", 
                          cntry == "DE" ~ "Germany", 
                          cntry == "IT" ~ "Italy",
                          TRUE ~ "REMOVE"))


graph %>% 
  ggplot(., aes(x= eduyrs, y = mean, group = country, color = country)) +
  geom_point(size = 3, alpha = 0.4) +
  theme_minimal() +
  theme(text=element_text(size=22, family="saira")) +
  labs(x ="- Education (Years) +", y = "- Attitudes Toward EU Integration (Mean) +", subtitle = "", title = "Level of Education & Attitudes Toward EU Integration", caption = "@JihedNcib | Data: ESS 2018") +
  theme(legend.position = c(0.75, 0.1)) +
  theme(legend.title=element_blank())