Dear members of the forum,
I am trying to reshape a dataset in the appropriate format. I work at the city/individual. Suppose I have this dataset:
I would simply like to turn it that way:
aaa, bbb, ccc, xxx, yyy, zzz are all individuals. With this second dataset, there is one observation per city/individual whereas in my current dataset I cannot work the way I want to because one observation denotes several individuals across different cities.
Is there a simple way to deal with this problem?
I am trying to reshape a dataset in the appropriate format. I work at the city/individual. Suppose I have this dataset:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str3(city1 city2 city3) "xxx" "yyy" "zzz" "aaa" "bbb" "ccc" end
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str5 city str3 individual "city1" "xxx" "city1" "aaa" "city2" "yyy" "city2" "bbb" "city3" "zzz" "city3" "ccc" end
Is there a simple way to deal with this problem?
Comment