I have pooled data from a survey that is done twice.
Some of the observations come from the same firm, but the firm was given different ids over the two years. However, I have an additional variable that signalizes a unique firm. I would use the group command, but I have a lot of missing variables and some numbers can reoccur in the second variable. The latter can be separated by using observations of country and year.
As you can see, by having the same number in the “panel” variable, observation 2 and 3 (+5 and 6) represent the same firm.
Any suggestions as to how I can convert this into (unbalanced) panel data?
Some of the observations come from the same firm, but the firm was given different ids over the two years. However, I have an additional variable that signalizes a unique firm. I would use the group command, but I have a lot of missing variables and some numbers can reoccur in the second variable. The latter can be separated by using observations of country and year.
Obs | Firm | Panel | Country | Year |
1 | 258 | 2 | USA | 1 |
2 | 658 | 3 | USA | 1 |
3 | 599 | 3 | USA | 2 |
4 | 245 | . | USA | 1 |
5 | 689 | 3 | Canada | 1 |
6 | 789 | 3 | Canada | 2 |
7 | 359 | 58 | Canada | 1 |
8 | 385 | . | Canada | 2 |
Any suggestions as to how I can convert this into (unbalanced) panel data?
Comment