educationalAttainment: Calculate educational attainment level.

Description Usage Arguments Details Examples

Description

Calculate educational attainment level according to Statistics Swedens classification of education.

Usage

1
educationalAttainment(object, attainments, missing)

Arguments

object

A vector of SUN2000NIVA codes

attainments

A named list of educational attainments to code, eg list(compulsory='mycode1', secondary='mycode2', tertiary='mycode3')

missing

The character code for a missing observation, defaults to '999' and are treated as other missing values in data.

Details

This function takes educational attainment codes according to Statistics Swedens classification (mostly named SUN2000NIVA in datasets) and recodes them into three levels where compulsory is equivalient of at most 9 years of education, secondary 9 to 12 years (one exception), and tertiary greater than 12 years. Warnings are generated if data contains codes that are unknown according to the offical documentation from statistics Sweden.

Some post secondary educations are included in secondary and these are shoften shorter than 2 years and occur outside university or job oriented educations shorter than 2 years at a university. See codes 410-417.

Examples

1
2
3
4
5
# 2 with compulsory education, 1 with secondary, 1 with tertiary, 2 missing
sunCodes <- c('001','200','312', '415', '525','999', NA)
newCodes <- educationalAttainment(sunCodes, list(compulsory=1, secondary=2, tertiary=3))
codes
# [1] "1", "1", "2", "2", "3", NA, NA

deepchocolate/pseregs documentation built on Dec. 27, 2021, 11:11 p.m.