Recode Age Education

If age exact is labelled to a number less than 10, coded to 15. Refused answers are coded to missing. Still studying answers are recoded to the exact age, when given, otherwise to missing.

recode_age_education(var, age_exact = NULL)

Arguments

var

Age Education variable

age_exact

The exact age variable, defaults to NULL.

See also

Other recode functions: recode_gender(), recode_mentioned()

Examples

#Exact age is given recode_age_education ( var = c( "2 years", "75 years", NA_real_, "Still studying", "Refusal", "No full-time education"), age_exact = c(87, 75, 34,23, 19, 45) )
#> [1] 15 75 NA 23 NA 15
#Exact age is not given, school living is recoded to missing recode_age_education ( var = c( "2 years", "75 years", NA_real_, "Still studying", "Refusal", "No full-time education") )
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> [1] 15 75 NA NA NA 15