Skip to contents

This function translates a vector of 4-digit ISCO88 codes to MPS codes using the translation table stored in all_schema$isco88_to_mps.

Usage

isco88_to_mps(x, to_factor = FALSE)

Arguments

x

A character vector of 4-digit ISCO codes.

to_factor

A logical value indicating whether to return a factor instead of a character. The order of the labels is taken from the sorted codes of MPS in all_schemas$isco88_to_mps.

Value

A character vector of MPS codes.

Details

This translation was taken from the iscogen Stata package. For more details, check out the package documentation and search for ISCO88 -> MPS.

Examples

library(dplyr)

ess %>%
  transmute(
    isco88,
    mps = isco88_to_mps(isco88),
  )
#> # A tibble: 48,285 × 2
#>    isco88 mps  
#>    <chr>  <chr>
#>  1 5169   56.1 
#>  2 1222   93.9 
#>  3 8120   NA   
#>  4 7141   52.5 
#>  5 6111   41.9 
#>  6 6111   41.9 
#>  7 9313   24.7 
#>  8 1221   112.3
#>  9 1221   112.3
#> 10 6111   41.9 
#> # ℹ 48,275 more rows