I am working with a dataset that contains some 75 variables I and would like to change the order of these variables.
I know I could do this manually for each variable to be moved with
Code:
order mo02student, after(mo01student)
The dataset I am working with looks like this:
ID | mo01student | mo01work | mo01unemployed | mo02student | mo02work | mo02unemployed |
12345 | 1 | 0 | 0 | 1 | 0 | 0 |
12346 | 0 | 0 | 1 | 0 | 1 | 0 |
So, I would want it to look like this:
ID | mo01student | mo02student | mo01work | mo02work | mo01unemployed | mo02unemployed |
12345 | 1 | 1 | 0 | 0 | 0 | 0 |
12346 | 0 | 0 | 0 | 1 | 1 | 0 |
Any help or thoughts on how the loop should look like would be much appreciated.
Best,
Ricka Baehnsch
0 Response to Looping with the order-command
Post a Comment