Hi! I have a Qualtrics survey with several questions that have "select all that apply" options. I want to separate out all the responses into dummy variables so they can be a bit more flexible. I originally did this:
gen feelings_traumatized = strmatch(feelings, "*4*")
label var feelings_traumatized "Experienced feeling traumatized"
label val feelings_traumatized feelings_traumatized
However, when I ran into a "select all that apply" question that had more than 9 responses available, the whole thing fell apart. I tried stuff like gen var_a = strmatch(var, "*1*" & !"*11*" & !"*21*"), but that didn't work.
Does anyone have a good way for dealing with cleaning these types of survey questions? If it helps, here is some of my output when I tab the variable:
Feelings | Freq. Percent Cum.
---------------------+-----------------------------------
1 | 1 0.29 0.29
1,2,3,5,7,8,11,16 | 1 0.29 0.59
1,3 | 2 0.59 1.17
1,3,5 | 1 0.29 1.47
1,3,5,11 | 1 0.29 1.76
1,3,5,13 | 1 0.29 2.05
1,3,5,6,7 | 1 0.29 2.35
1,3,5,7 | 6 1.76 4.11
1,3,5,7,11 | 2 0.59 4.69
1,3,5,7,11,16 | 1 0.29 4.99
I've been stuck on this for a while and would really appreciate any insight anyone can offer. Thank you!
Related Posts with Data cleaning: Select all that apply
stpm2 dfHello, I would like to analyze through a flexible parametric survival models because Cox's assumpti…
New package on SSC: peerreviewThanks to Kit Baum, a new package -peerreview- is now available on SSC. -peerreview- randomly assig…
Correlation of one variable across countries in Panel DataHi all, I am working with a Panel-Data set that includes a number of variables (e.g. Credit, GDP) a…
SIC codes matchingHi, I want to match the SIC codes of the target and acquirer using SDC data (SIC codes). I already d…
Correction for Probit with FE (Cross-section) - Incidental parametersDear all, I am running a probit model (since my dependent variable is binary) using Fixed Effects (…
Subscribe to:
Post Comments (Atom)
0 Response to Data cleaning: Select all that apply
Post a Comment