edu_compute: Fill inn Education in MOAS

View source: R/edu-funcs.R

edu_computeR Documentation

Fill inn Education in MOAS

Description

Using existing data in the MOAS, fills in gaps, converts from on type of coding to another etc.

Usage

edu_compute(
  data,
  edu4 = edu_coded4,
  edu9 = edu_coded10,
  edu_years = edu_years,
  prefix = "edu_",
  keep_all = TRUE
)

Arguments

data

MOAS-like data

edu4

unquoted column containing Education coded in 4 categories

edu9

unquoted column containing Education coded in 4 categories

edu_years

unquoted column containing Education in years to highest completed

prefix

string to prefix column names of computed values

keep_all

logical, append to data.frame

Value

a data.frame

See Also

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

Examples


edu <- data.frame(
    edu4 = c("3", "High school", 1, NA,
         "University/University college (> 4 years)", NA, 
          "University/University college (< 4 years)"),
    edu9 = c(7,7,8,NA,"Primary school (6 years)",5, 9),
    edu_years = c(NA, 12, 9, NA, 19, 19, NA),
    mother = c("3", "High school", 1, NA,
               "University/University college (> 4 years)",
               "University/University college (> 4 years)", 
               "University/University college (< 4 years)"),
    father = c(7,7,8,4,"Primary school (6 years)",5, 10),
    stringsAsFactors = FALSE
    )
 
 edu_compute(edu,
             edu4 = edu4,
             edu9 = edu9, 
             edu_years = edu_years)

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