Chapter 3 Data

To reproduce results obtained with SOEP-IS 2012 and ALLBUS 2014 the original data was considered1. For conducting the analysis in ALLBUS 2014 the Stata file version 2.1.0 was downloaded from the GESIS Central Archive doi: 10.4232/1.12288. In the case of SOEP-IS 2012, I used the Stata files “inno.dta” and “bio.dta” in the folder “soep-is.2016.1_stata_en” sent by the Research Data Center of the SOEP after signing the Data Distribution Contract.

For reproduction purposes, the only original results associated with these sources that cannot be directly downloaded from the article website are in Table 7 and Table 8 from the article. Directly scraping them requires access to the article on Springer. Consequently, results in these tables are separetely built in comma-separated values files for each one (“tab7_original.csv” and “tab8_original.csv”). Table 15 in the Appendix and Table A6 on supplementary materials can be directly downloaded from the website.

3.1 SOEP-IS 2012

data_path <- "C:/Users/CM/Dropbox/2016 - Justicia, cambio y desigualdad/Estudio 3/BSJO_testing/reproducibility/data_rep/"
soep.is <- read_dta(paste0(data_path, "inno.dta"))
bsjo.soep <- data.frame(C = soep.is$sim0403, K = soep.is$sim0411, 
                        E = soep.is$sim0405, J = soep.is$sim0410,
                        B = soep.is$sim0402, I = soep.is$sim0409,
                        D = soep.is$sim0404, L = soep.is$sim0412)

bsjo.soep <- sapply(bsjo.soep, function(x) ifelse(x >= 1 & x <= 7, x, NA))
bsjo.soep <- as.data.frame((na.omit(bsjo.soep)))

3.2 ALLBUS 2014

albs <- read_dta(paste0(data_path, "ZA5240_v2-1-0.dta"))
names(albs) <- tolower(names(albs))
bsjo.albs <- data.frame(C = albs$v218, K = albs$v223, E = albs$v220, J = albs$v222,
                        B = albs$v217, I = albs$v221, D = albs$v219, L = albs$v224)
bsjo.albs <- sapply(bsjo.albs, function(x) ifelse(x >= 1 & x <= 5, x, NA))
bsjo.albs <- as.data.frame((na.omit(bsjo.albs)-6)*-1)

  1. For results reproduction of this report the absolute path (data_path) must be adjusted according to the local repository where the files “inno.dta”, “bio.sta”, “ZA5240_v2-1-0.dta”, “tab7_original.csv” and “tab8_original.csv” are located.