Code demographic variables in responses
code_party_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' U.S. political party affiliation:
party5
: 5-point U.S. political party leaning (i.e. Dem, Lean Dem, Ind, Lean Rep, Rep)party3
: 3-point U.S. political party affiliation (i.e. "forced" to Dem, Ind, Rep)