I am often faced with a need to translate ISCO codes into another format. As yet there is no complete package for doing so in R. Here is my attempt to fill that void. In undertaking this package I have noted several concerns:
#scape data directly from Ganzeboom's website. This is the Appendix A from his paper
library(rvest)
url <- html('http://www.harryganzeboom.nl/ismf/scaleapp.htm')
#extract content
text <- url %>%
html_node("pre") %>%
html_text()
#Lots for regular expressions to whip into shape
text <- strsplit(text, "\n+")
text <- text[[1]][-c(1:2)]
text<- grep("^.?[0-9].+",text, value = TRUE)
text[305] <- gsub("^[[:blank:]]","", text[305])
text <- gsub("\r", "", text)
text2 <- gsub("(^[0-9]{1,2})[[:blank:]]+([0-9]{1,2})[[:blank:]]+([0-9]{1,2})[[:blank:]]+([0-9]{4}).|\\s+([\\[\\]\\,A-Z]+.*$)",
"\\1\t\\2\t\\3\t\\4\t\\5", text)
#Put into a data.frame
text3 <-do.call(rbind.data.frame,strsplit(text2, "\t"))
#Add names
names(text3) <- c("SIOPS","ISEI","EGP","ISCO","JobDescription")
text3[,1:3] <- apply(text3[,1:3], 2, function(x) as.numeric(as.character(x)))
#Clean description of jobs
text3$JobDescription <- gsub("^[[:blank:]]+", "", text3$JobDescription)
The package uses ISCO-88 as base code, with correspondence hash tables provided to get from other common codes to this base code. The main envisioned workflow is:
For EGP it is important to note that no distinction is made between classes 3 and 4 with code 3 used as a catch all for "Routine non-manual" jobs. Likewise, ISCO-88 contains no codes for self-employed or unemployed individuals. The convert function provides an argument to provide user to provide user-defined values for self-employed and unemployed. This will return 6 (for self-employed) and 12 (for unemployed). When ISEI or SIOPS is requested, user defined values are ignored and NA is returned.
ISCO-88 correspondence table from Ganzeboom's code SPSS code
ANZSCO based on ABS correspondance tables
Correspondence table from ISCO-08 to ISCO-88
library(devtools)
install_git("https://github.com/pdparker/isco88conversion")