These value-value tables are useful for recoding the values of from one dataset (CCES) so that they can be merged immediately with another (ACS). These get used internally in ccc_std_demographics, but they are available as built in datasets.

race_key

gender_key

educ_key

age5_key

age10_key

states_key

Format

All keys are tibbles with one row per recoding value.

race_key

race

An labelled integer of class haven::labelled. Most compact form of both sources and the values both will get recoded to in MRP.

race_cces

Labelled versions of the CCES race codings. These are of the same class as the CCES cumulative file.

race_cces_chr

Labels for the first column, in characters

race_acs

Corresponding character in the ACS data via the tidycensus package

race_num

A numeric value underlying the race label.

gender_key:

gender

An labelled integer of class haven::labelled. Target variable

gender_chr

Character to recode from. CCES and ACS use the same values.

educ_key

For mapping ACS data values for education e.g. in get_acs_cces:

educ_cces_chr

Character to recode from, in CCES

educ_chr

Character to recode from, in ACS.

educ

An labelled integer of class haven::labelled. Target variable

age5_key

Age bins, 5-ways, used in acscodes_age_sex_educ. Use ccc_bin_age to recode CCES variable

age

An labelled integer of class haven::labelled. Target variable.

age_chr

Character to recode from, in ACS

age10_key: Age bins, 10-ways, used in acscodes_age_sex_race:

age

An labelled integer of class haven::haven_labelled. Target variable.

age_chr

Character to recode from, in ACS

states_key: State codes and regions:

st

State two-letter abbreviation state.abb

state

State full name via state.name

st_trad

State traditional abbreviation following AP style

st_fips

Integer, state FIPS code

region

Census region (Northeast, Midwest, South, West)

division

Census division (New England, Middle Atlantic, South Atlantic, East South Central, West South Central, East North Central, "West North Central, Mountain, Pacific)

Details

These tibbles themselves are not key-values pair in a strict sense because the dataframe tries to have two recodes CCES to common and ACS to common and so for a given recode, rows are not distinct. To avoid duplicating rows inadvertently, use the dplyr::distinct to reduce the key to two columns with unique rows.

Examples

library(ccesMRPprep) race_key
#> # A tibble: 9 × 5 #> race_num race_cces_chr race_acs race_cces race #> <int> <chr> <chr> <int+lbl> <int+lbl> #> 1 1 White WHITE ALONE, NOT HISPANIC… 1 [White] 1 [White] #> 2 2 Black BLACK OR AFRICAN AMERICAN… 2 [Black] 2 [Black] #> 3 3 Hispanic HISPANIC OR LATINO 3 [Hispanic] 3 [Hispanic] #> 4 4 Asian ASIAN ALONE 4 [Asian] 4 [Asian] #> 5 4 Asian NATIVE HAWAIIAN AND OTHER… 4 [Asian] 4 [Asian] #> 6 5 Native American AMERICAN INDIAN AND ALASK… 5 [Native A… 5 [Native A… #> 7 6 Mixed TWO OR MORE RACES NA 6 [All Othe… #> 8 6 Other SOME OTHER RACE ALONE NA 6 [All Othe… #> 9 6 Middle Eastern NA NA 6 [All Othe…
educ_key
#> # A tibble: 10 × 4 #> educ_chr educ_cces_chr doc_note educ #> <chr> <chr> <chr> <dbl+l> #> 1 Less than 9th grade No HS NA 1 [HS … #> 2 9th to 12th grade no diploma No HS ACS spell… 1 [HS … #> 3 9th to 12th grade, no diploma No HS ACS spell… 1 [HS … #> 4 High school graduate (includes equivalency) High School G… NA 1 [HS … #> 5 High school graduate, GED, or alternative High School G… NA 1 [HS … #> 6 Some college no degree Some College ACS spell… 2 [Som… #> 7 Some college, no degree Some College ACS spell… 2 [Som… #> 8 Associate's degree 2-Year Lumped in… 2 [Som… #> 9 Bachelor's degree 4-Year NA 3 [4-Y… #> 10 Graduate or professional degree Post-Grad NA 4 [Pos…
gender_key
#> # A tibble: 2 × 2 #> gender_chr gender #> <chr> <int+lbl> #> 1 Male 1 [Male] #> 2 Female 2 [Female]
age5_key
#> # A tibble: 5 × 2 #> age_chr age #> <chr> <int+lbl> #> 1 18 to 24 years 1 [18 to 24 years] #> 2 25 to 34 years 2 [25 to 34 years] #> 3 35 to 44 years 3 [35 to 44 years] #> 4 45 to 64 years 4 [45 to 64 years] #> 5 65 years and over 5 [65 years and over]
age10_key
#> # A tibble: 10 × 3 #> age_chr age_num age #> <chr> <int> <int+lbl> #> 1 18 and 19 years 1 1 [18 to 24 years] #> 2 20 to 24 years 1 1 [18 to 24 years] #> 3 25 to 29 years 2 2 [25 to 34 years] #> 4 30 to 34 years 2 2 [25 to 34 years] #> 5 35 to 44 years 3 3 [35 to 44 years] #> 6 45 to 54 years 4 4 [45 to 64 years] #> 7 55 to 64 years 4 4 [45 to 64 years] #> 8 65 to 74 years 5 5 [65 years and over] #> 9 75 to 84 years 5 5 [65 years and over] #> 10 85 years and over 5 5 [65 years and over]
states_key
#> # A tibble: 50 × 6 #> st state st_trad st_fips region division #> <chr> <chr> <chr> <int> <fct> <fct> #> 1 AL Alabama Ala. 1 South East South Central #> 2 AK Alaska Alaska 2 West Pacific #> 3 AZ Arizona Ariz. 4 West Mountain #> 4 AR Arkansas Ark. 5 South West South Central #> 5 CA California Calif. 6 West Pacific #> 6 CO Colorado Colo. 8 West Mountain #> 7 CT Connecticut Conn. 9 Northeast New England #> 8 DE Delaware Del. 10 South South Atlantic #> 9 FL Florida Fla. 12 South South Atlantic #> 10 GA Georgia Ga. 13 South South Atlantic #> # … with 40 more rows