Skip to contents

This function translates a vector of 2-digit ISCO08 codes to ESEC codes using the translation table stored in all_schema$isco08_two_to_esec.

Usage

isco08_two_to_esec(
  x,
  is_supervisor,
  self_employed,
  n_employees,
  label = FALSE,
  to_factor = FALSE
)

Arguments

x

A character vector of 2-digit ISCO codes. This should be the 4-digit equivalent so instead of 13, the code should be 1300, which is the 4-digit version of of the 2-digit ISCO.

is_supervisor

A numeric vector indicating whether each individual is a supervisor (1, e.g. responsible for other employees) or not (0).

self_employed

A numeric vector indicating whether each individual is self-employed (1) or an employee (0).

n_employees

A numeric vector indicating the number of employees under each respondent.

label

A logical value indicating whether to return the labels of the translated ESEC codes (default is FALSE).

to_factor

A logical value indicating whether to return a factor instead of a character. The order of the labels is taken from the labels for ESEC found in all_labels (default is FALSE).

Details

This function will accept 2 digit codes as 4 digits. This means that if the 2-digit code is 13 then it should be 1300. All codes should be 4 digits, even though the code is represented as 2-digits (1300, 1400, etc..)

This is exactly the same as DIGCLASS::isco08_to_esec but for two digit ISCO.

For more information on this class schema, please check the references below:

Examples

library(dplyr)

# convert to two digits
ess$isco08_two <- isco08_swap(ess$isco08, from = 4, to = 2)

ess %>%
  transmute(
    isco08_two,
    esec = isco08_two_to_esec(
      isco08_two,
      is_supervisor,
      self_employed,
      emplno,
      label = FALSE
    ),
    esec_label = isco08_two_to_esec(
      isco08_two,
      is_supervisor,
      self_employed,
      emplno,
      label = TRUE
    )
  )
#> # A tibble: 48,285 × 3
#>    isco08_two esec  esec_label                                                
#>    <chr>      <chr> <chr>                                                     
#>  1 5400       3     'Intermediate occupations'                                
#>  2 1300       4     'Small employers and self-employed (non-agriculture)'     
#>  3 3100       2     'Lower mgrs/professionals, higher supervisory/technicians'
#>  4 7100       4     'Small employers and self-employed (non-agriculture)'     
#>  5 6100       6     'Lower supervisors and technicians'                       
#>  6 6100       5     'Small employers and self-employed (agriculture)'         
#>  7 9300       5     'Small employers and self-employed (agriculture)'         
#>  8 1300       4     'Small employers and self-employed (non-agriculture)'     
#>  9 1300       1     'Large employers, higher mgrs/professionals'              
#> 10 6100       5     'Small employers and self-employed (agriculture)'         
#> # ℹ 48,275 more rows