Dear stata community,
I have two datasets I want to merge: master data contains many individuals clustered in firms on the year level and the other one has simple month yearly firmlevel data. The problem is, the master data does contain one month for each director ID, so it is not a one to one match, we want to "fill
-in" the other months for every director with the using dataset. Therefore my Datasets look as follows:
Individual Dataset (master):
Firmlevel dataset (using):
In the End I want to achive a dataset which looks something like this:
I have two datasets I want to merge: master data contains many individuals clustered in firms on the year level and the other one has simple month yearly firmlevel data. The problem is, the master data does contain one month for each director ID, so it is not a one to one match, we want to "fill
-in" the other months for every director with the using dataset. Therefore my Datasets look as follows:
Individual Dataset (master):
CompnayID | year | month | DirectorID | other variables |
1 | 2000 | 3 | 1 | |
1 | 2000 | 3 | 2 | |
1 | 2000 | 4 | 3 | |
1 | 2000 | 6 | 4 | |
2 | 2000 | 3 | 5 | |
2 | 2000 | 3 | 6 | |
2 | 2000 | 3 | 7 | |
... | ... | ... | ... | ... |
Compnay ID | year | month | other variables |
1 | 2000 | 1 | |
1 | 2000 | 2 | |
1 | 2000 | 3 | |
1 | 2000 | 4 | |
1 | 2000 | 5 | |
1 | 2000 | 6 | |
1 | 2000 | 7 | |
... | ... | ... | ... |
CompanyID | DirectorID | year | month | other variables from both datasets |
1 | 1 | 2000 | 1 | |
1 | 1 | 2000 | 2 | |
1 | 1 | 2000 | 3 | |
1 | 1 | 2000 | 4 | |
1 | 1 | 2000 | 5 | |
1 | 1 | 2000 | 6 | |
... | ... | ... | ... | ... |
1 | 2 | 2000 | 1 | |
1 | 2 | 2000 | 2 | |
1 | 2 | 2000 | 3 | |
.. | .. | .. | ... | ... |
Comment