Code demographic variables in responses
code_race_vars.Rd
Given a dataframe of survey responses, look for standard SurveyMonkey demographic questions and code/recode them into new variables that are more banner-, plot-, and analysis-friendly. Use code_std_demo_vars()
to perform all standard demographic recodes, or select the specific function you need. Run std_demo_vars()
to return the full index of SurveyMonkey's standard demographic variables.
Value
Survey data frame with new (or updated) columns corresponding to (if discoverable) respondents' race and/or ethnicity
race5
: 5-point standard Census race category (i.e. Non-Hispanic White, Non-Hispanic Black, Hispanic, Asian, Other)race4
: 4-point categorization collapsing "Asian" into "Other" (needed for some weighting schemes)nonwhite
: 2-point race category for white/non-white