namevalue: CCES-ACS variable key value pairs for recoding

namevalueR Documentation

CCES-ACS variable key value pairs for recoding

Description

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.

Usage

race_key

gender_key

educ_key

educ3_key

ed_ed3_cces

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 four-way 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

educ3_key

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

educ_cces_chr

Character to recode from, in CCES

educ_chr

Character to recode from, in ACS.

educ3

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

ed_ed3_cces

A key to link educ (4-way) and educ3

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
 educ_key
 educ3_key
 gender_key
 age5_key
 age10_key
 states_key

kuriwaki/ccesMRPprep documentation built on July 27, 2023, 3:34 a.m.