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
Merging dataset with non-unique variables in the master dataDear all, I am currently trying to merge two datasets. One contains household data and the other pe…
pwcompare and effect sizeHello, Stata world. I'm using -pwcompare, effects- after regression. The command produces point esti…
Help on Threshold regressioGood afternoon to you all My name is David and am new to Stata. My problem is that i want to use Sta…
pwcompare and Cohen's dHello, Stata world. I'm using -pwcompare, effects- after regression. The command produces point esti…
Fixed effects and interaction termsHello, I have a little question. I am analyzing a simple fixed effects model. I have my firms classi…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting Multiple Response Variable
Post a Comment