I have a data set that looks like (see below), where x1-x4 are observations for 4 different individuals. I want to stack these into a panel, including a date column, and a column with the specific individual identifier (in this case simply x1, x2, x3, x4). I know how to do this with "stack date x1 date x2 date x3 date x4" (but I don't know how to "simply" get the individual identifiers). Now, my "real" question is: suppose I have 20,000 individuals (with not nice identifiers, e.g., slkijs1, sliiily, 889098, 1234145....). Clearly, my stack example above would be exceedingly tedious. I end up having to do this a lot, so any suggestions would be MOST appreciated. I'm sure I've overlooked some very basic information, but... thanks.
date | x1 | x2 | x3 | x4 |
8-Jan-08 | 44.267 | 71.24366 | 7.064299 | 53.01147 |
9-Jan-08 | 21.462 | 12.1015 | 46.61863 | 20.77969 |
10-Jan-08 | 75.883 | 35.21949 | 2.601562 | 57.79749 |
11-Jan-08 | 83.377 | 66.84127 | 25.44249 | 90.14868 |
14-Jan-08 | 67.533 | 17.24804 | 67.00962 | 11.29083 |
15-Jan-08 | 67.819 | 68.5128 | 14.26676 | 76.55122 |
16-Jan-08 | 15.461 | 15.63645 | 95.98777 | 75.82653 |
17-Jan-08 | 19.519 | 40.68843 | 19.62687 | 86.06653 |
18-Jan-08 | 87.716 | 63.43431 | 81.71249 | 90.69047 |
21-Jan-08 | 16.507 | 64.96755 | 40.14056 | 0.718889 |
Comment