Turn education data to years
edu_to_years(x, levels)
edu4_to_years(x)
edu9_to_years(x)
character vector
levels returned from the edu_levels() function
vector of integers
Specialized returns
edu_to_years - Alter education to years specifying number of levels
edu4_to_years - directly alter 4-level coded education to years
edu9_to_years - directly alter 9-level coded education to years
Other edu_functions:
edu_compile()
,
edu_compute()
,
edu_factorise()
,
edu_levels2name()
,
edu_levels()
,
edu_reduce()
edu4 <- c("3", "High school", "1", NA,
"University/University college (> 4 years)",
NA, "University/University college (< 4 years)")
edu_to_years(edu4, 4)
#> [1] 16 12 9 NA 19 NA 16
edu4_to_years(edu4)
#> [1] 16 12 9 NA 19 NA 16
edu9 <- c("7", "7", "8", NA, "Primary school (6 years)", "5", "9")
edu_to_years(edu9, 9)
#> [1] 16 16 19 NA 6 13 21
edu9_to_years(edu9)
#> [1] 16 16 19 NA 6 13 21