R/cces_std-for-acs.R
ccc_bin_age.Rd
Discretize a vector of age integers into labelled variables
ccc_bin_age(agevec, agelbl = deframe(ccesMRPprep::age5_key))
The recoding is governed by age5_key
. IT currently only accepts
5-way binning, following the ACS.
ccc_bin_age(c(15:100, NA))
#> <labelled<integer>[87]>
#> [1] NA NA NA 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3
#> [26] 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
#> [51] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
#> [76] 5 5 5 5 5 5 5 5 5 5 5 NA
#>
#> Labels:
#> value label
#> 1 18 to 24 years
#> 2 25 to 34 years
#> 3 35 to 44 years
#> 4 45 to 64 years
#> 5 65 years and over