I have a multiple response variable that may take any combination of responses between 1 to 5 and 97. For instance, the variable may have responses in any of the following (i) 1 only or (ii) 2 and 3, or (iii) 97 only, or (iv) 3, 5, and 97, or (v) 1, 2, 3, 4, 5, and 97, or (vi) any other possible combinations. The variable is in string form with each response separated by a space. I would like to split this variable into 6 different variables for each choices/responses. For instance variable_1, variable_2, ........., variable_97. For each of these individual variables, I want responses in 0 and 1 (true false) format. For example, if a response has values 3 and 5. I want value 1(or true) for variables "var_3" and "var_5" and value 0 (false) for the rest of the variables.
Could anyone kindly suggest a way of splitting the variables in this way in STATA?
Thanks.
Related Posts with Splitting Multiple Response Variable
Error in mi impute chained (logit)Hello, I am trying to run an mi impute chained using (logit) and I get the following error message …
Centering on Mean - Interaction of 2 continous variables using the first difference estimatorHi, My research project is looking at the impact of financial development (bank development - proxi…
define after a certain rangeHello, I want to define a variable conditioned after a certain range of another variable. For inst…
Dropping observations based on multiple conditionsHi Everyone, Thanks for taking the time to read my query. I currently am cleaning a very big datase…
how to backup files betterHello! When I use stata to clean data,I always want to keep track of every step I take so that I can…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting Multiple Response Variable
Post a Comment