Description Usage Arguments Value Examples
The CPS publishes their data in a numeric format, with a separate
PDF codebook (not machine readable) describing factor values. This function
labels the raw numeric CPS data according to a supplied factor key. Codes
that appear in a given year and are not included in factors
will be
recoded as NA
.
1 2 3 4 5 6 7 8 9 |
data |
The raw CPS data that factors should be applied to |
factors |
A data frame containing the label codes to be applied |
names_col |
Which column of |
na_vals |
Which character values should be considered "missing" across the dataset and be set to NA after labelling |
expand_year |
Whether to change the two-digit year listed in earlier surveys (94, 96) into a four-digit year (1994, 1996) |
rescale_weight |
Whether to rescale the weight, dividing by 10,000. The CPS describes the given weight as having "four implied decimals", so this rescaling adjusts the weight to produce sensible population totals. |
toupper |
Whether to convert all factor levels to uppercase |
CPS data with factor labels in place of the raw numeric data
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.