library(tidyverse) library(sjPlot) # IMD2003 >>> EDUCATION # IMD3010 >>> SATISFACTION WITH DEMOCRACY #0. NONE (NO EDUCATION)/ILLITERATE #1. PRIMARY EDUCATION/LOWER SECONDARY EDUCATION #2. HIGHER SECONDARY EDUCATION #3. POST-SECONDARY (NON-UNIVERSITY) EDUCATION #4. UNIVERSITY EDUCATION #6. OTHER [SEE Standalone CSES MODULE CODEBOOK] #7. VOLUNTEERED: REFUSED #8. VOLUNTEERED: DON'T KNOW # 9. MISSING # 1. VERY SATISFIED # 2. FAIRLY SATISFIED # 4. NOT VERY SATISFIED # 5. NOT AT ALL SATISFIED # 6. NEITHER SATISFIED NOR DISSATISFIED # 7. VOLUNTEERED: REFUSED # 8. VOLUNTEERED: DON'T KNOW # 9. MISSING #download data https://drive.google.com/file/d/1qhjPh64IJKIuDdj3W1UIlaBweNRoG18j/view?usp=sharing #codebook https://cses.org/wp-content/uploads/2020/12/cses_imd_codebook_part2_variables.txt load("/Volumes/GoogleDrive/Můj disk/Disertace/Data/Kvantitativni/CSES/cses_imd.rdata") table(cses_imd$IMD2003, cses_imd$IMD3010) cses_imd <- cses_imd %>% mutate(edu = IMD2003, dem = IMD3010) cses_imd_filter <- cses_imd %>% filter(edu < 6) %>% filter(dem < 6) cses_imd_filter %>% select(edu, dem) cses_cz96 <- cses_imd_filter %>% filter(IMD1004 == "CZE_1996") table(cses_imd_filter$edu, cses_imd_filter$dem) table(cses_cz96$edu, cses_cz96$dem) chisq.test(table(cses_cz96$edu, cses_cz96$dem)) sjt.xtab(cses_cz96$dem, cses_cz96$edu) sjt.xtab(cses_cz96$dem, cses_cz96$edu, show.exp = T) sjt.xtab(cses_cz96$dem, cses_cz96$edu, show.exp = T, show.row.prc = T) sjt.xtab(cses_cz96$dem, cses_cz96$edu) cor.test(cses_cz96$dem, cses_cz96$edu, method="kendall") #perform chi-square test for CZ 2010 and variables satisfaction with democracy and gender