library(tidyverse)
library(haven)
ess8 <- read_dta("../data/ESS8e02_2.dta")
# gruppieren
ess8 <- group_by(ess8,cntry)
# zusammenfassen
democracy <- summarise(ess8,
mean_stfgov=mean(stfgov,na.rm=T),
mean_stfdem=mean(stfdem,na.rm=T))
# Demokratie Variable
democracy$cee <- ifelse(democracy$cntry %in%
c("CZ","EE","HU","LT","PL","SI"),
"CEE","other")