edu_reduce: Reduce education categories

View source: R/edu-funcs.R

edu_reduceR Documentation

Reduce education categories

Description

These functions will aid in converting one education scheme into another. While you may attempt to go from a low level to a high (from 4 to 9), there is no way to actually do that in a consistent way that will correctly reflect the underlying data.

Usage

edu_reduce(x, from, to)

edu9_reduce(x, to = 4)

Arguments

x

character vector

from

factor level to transform from

to

factor level to transform to

Details

Always go from a higher level scheme to a lower one (currently from 9 to 4 only)

Specialized returns

  • edu_reduce - reduce with own to and from specification

  • edu9_reduce - directly reduce from 9 to 4

Value

factor

See Also

Other edu_functions: edu_compile(), edu_compute(), edu_factorise(), edu_levels2name(), edu_levels(), edu_to_years()

Examples

edu9 <- c("7", "7", "8", NA, "Primary school (6 years)", "5", "9")
edu_reduce(edu9, 9, 4)
edu9_reduce(edu9)

LCBC-UiO/Questionnaires documentation built on July 18, 2023, 6:45 p.m.