Case study: Exploring translations between social classes using the ESS data
case-study-translations-social-classes-ess.Rmd
Exploring translations between social classes
Let’s suppose you’ve received a dataset which contains the
International Standard Classification of Occupations (ISCO) on
occupations of respondents in a survey. In particular, you’ve got only
the ISCO classification for the year 1968, which is a bit outdated. With
the package DIGCLASS
you can translate that classiciation
to many others. Let’s load our package and use the data ess
which contains ISCO68 from the European Social Survey.
library(DIGCLASS)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
ess
#> # A tibble: 48,285 × 12
#> isco68 isco88 isco88com isco08 emplno self_employed is_supervisor
#> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 5890 5169 5169 5414 0 1 0
#> 2 2120 1222 1222 1321 0 0 1
#> 3 7200 8120 8120 3135 0 0 0
#> 4 9310 7141 7141 7131 0 0 1
#> 5 6220 6111 6111 6111 0 0 0
#> 6 6220 6111 6111 6111 0 0 1
#> 7 9595 9313 9313 9313 0 0 1
#> 8 6000 1221 1221 1311 0 0 1
#> 9 6000 1221 1221 1311 2 1 1
#> 10 6220 6111 6111 6111 0 0 1
#> # ℹ 48,275 more rows
#> # ℹ 5 more variables: control_work <dbl>, control_daily <dbl>,
#> # work_status <dbl>, main_activity <dbl>, agea <dbl>
As you can see, this dataset contains isco68
,
isco88
and isco08
. Assume for a second that
you do not have isco88
and
isco08
and you’d like to translate isco68
to
other class schemas. In DIGCLASS
you will find all
functions that translate isco68
begin with
isco68_
. So if you typed on your text editor
isco68_
and hit TAB
, presumably you’ll get
auto-completion for all possible translations. Here’s a selected number
of translations you can get for isco68
:
# Set `labels` to `FALSE` to obtain
# the translated number instead of the label
labs <- FALSE
# For some class schemas we use the number of employees that
# the respondent has in their job. Here we're just recoding
# some values that are missing.
ess <- ess %>% mutate(emplno = if_else(emplno > 10000, 0, emplno))
# Translate `isco68` to many class schemas
ess %>%
select(isco68, self_employed, emplno) %>%
transmute(
isco68,
isco88 = isco68_to_isco88(isco68, label = labs),
isco08 = isco68_to_isco08(isco68, label = labs),
siops = isco68_to_siops(isco68),
isei = isco68_to_isei(isco68),
egp = isco68_to_egp(isco68, self_employed, emplno, label = labs),
)
#> # A tibble: 48,285 × 6
#> isco68 isco88 isco08 siops isei egp
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 5890 5169 5414 30 35 6
#> 2 2120 1220 1321 64 67 2
#> 3 7200 7220 8120 38 34 8
#> 4 9310 7141 7131 31 32 8
#> 5 6220 9211 9211 21 16 10
#> 6 6220 9211 9211 21 16 10
#> 7 9595 9313 9313 15 24 9
#> 8 6000 1311 6100 48 46 11
#> 9 6000 1311 6100 48 46 11
#> 10 6220 9211 9211 21 16 10
#> # ℹ 48,275 more rows
As you can see, we got all translations done rather quickly.
DIGCLASS
aims to have a consistent interface, meaning
that if you happen to have ISCO88 instead of ISCO68, the same convention
for all functions is used:
ess %>%
select(isco88, self_employed, emplno) %>%
transmute(
isco88,
isco68 = isco88_to_isco68(isco88, label = labs),
isco88com = isco88_to_isco88com(isco88, label = labs),
isco08 = isco88_to_isco08(isco88, label = labs),
siops = isco88_to_siops(isco88),
isei = isco88_to_isei(isco88),
mps = isco88_to_mps(isco88),
egp = isco88_to_egp(isco88, self_employed, emplno, label = labs),
oesch = isco88_to_oesch(isco88, self_employed, emplno, label = labs)
)
#> # A tibble: 48,285 × 9
#> isco88 isco68 isco88com isco08 siops isei mps egp oesch
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 5169 5890 5169 5419 30 40 56.1 9 4
#> 2 1222 2120 1222 1321 60 67 93.9 1 9
#> 3 8120 7200 8120 8120 40 30 NA 8 8
#> 4 7141 9310 7141 7131 31 29 52.5 8 7
#> 5 6111 6220 6111 6111 40 23 41.9 10 7
#> 6 6111 6220 6111 6111 40 23 41.9 10 7
#> 7 9313 9595 9313 9313 15 21 24.7 9 8
#> 8 1221 6000 1221 1311 60 67 112.3 11 9
#> 9 1221 6000 1221 1311 60 67 112.3 11 3
#> 10 6111 6220 6111 6111 40 23 41.9 10 7
#> # ℹ 48,275 more rows
Similarly, you can apply transformations for ISCO08 following the
same skeleton. For this one let’s see labs = TRUE
to check
the labels:
labs <- TRUE
ess %>%
select(isco08, self_employed, emplno) %>%
transmute(
isco08,
isco88 = isco08_to_isco88(isco08, label = labs),
siops = isco08_to_siops(isco08),
isei = isco08_to_isei(isco08),
oesch = isco08_to_oesch(isco08, self_employed, emplno, label = labs)
)
#> # A tibble: 48,285 × 5
#> isco08 isco88 siops isei oesch
#> <chr> <chr> <chr> <chr> <chr>
#> 1 5414 'Protective services workers not elsewhere classifi… 27.89 27 'Sma…
#> 2 1321 'Production and operations department managers in m… 64.00 63 'Hig…
#> 3 3135 'Metal-processing-plant operators' 34.91 37 'Tec…
#> 4 7131 'Painters and related workers' 30.92 33 'Ski…
#> 5 6111 'Field crop and vegetable growers' 43.53 16 'Ski…
#> 6 6111 'Field crop and vegetable growers' 43.53 16 'Ski…
#> 7 9313 'Building construction labourers' 15.00 22 'Low…
#> 8 1311 'Production and operations department managers in a… 61.15 60 'Low…
#> 9 1311 'Production and operations department managers in a… 61.15 60 'Sma…
#> 10 6111 'Field crop and vegetable growers' 43.53 16 'Ski…
#> # ℹ 48,275 more rows
Notice that some classes translate to the labels (isco88
and oesch
) but others like isei
and
siops
are actual numeric translations. That’s because they
don’t have a label
argument; they are continuous
scales.
Note that swapping the first part of the function
(isco88_
or isco68_
) for another ISCO will not
always work because not all isco**
have the same
translations. Be sure to check the reference of functions to see which
translations are available for each ISCO class schema.