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
Meta forestplot and Meta summarizeDear Stata Users, I am working in a meta analysis of prior 20 studies. In several studies I have co…
Reshape Best to Worst datasetDear all, I turn to you for a second request for help linked to the question at the link: https://ww…
2020 Swiss Stata Conference takes place virtuallyDue to the development of the situation, the Swiss Stata Conference on November 19 will take place v…
Using data from multiple files (Excel)Hi everyone, I'm still taking my first steps in Stata. Still, I have quite a lot of data (simulated…
Logit Confidence IntervalsHi, I was wondering whether someone could help me get less confused. I have run a logit model , whe…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting Multiple Response Variable
Post a Comment