make_age_group_var | R Documentation |
make_age_group_var()
creates a 3-level age group variable in ACS,
CPS ASEC, or basic monthly CPS microdata. Levels include under 18, 18 to 64,
and 65 and over.
make_age_group_var(df, dataset, name = "age_group")
df |
Data frame to add age group variable to. |
dataset |
Dataset corresponding to |
name |
Name to give age group variable. Defaults to |
For the ACS, years 2005 to present are supported and the required variable
is agep
. For the CPS ASEC, survey years 1998 to present are supported
and the required variable is a_age
. For the basic monthly CPS, years
1998 to present are supported and the required variable is prtage
.
A data frame.
This function is designed to work with original, Census-based ACS or CPS microdata. (As opposed to Census microdata that have been processed by, for example, IPUMS.) Therefore, prior to using this function you should ensure that your data are behaving according to their official data dictionary.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.