Good evening to everyone,
This is my first post on this forum, so I am looking forward to collaborate with the Stata community.
I am currently encountering a slight problem; I would like to merge two panel data sets, whose structure is the following:
Master dataset:
and User Dataset:
Note that some observations (characterized by a couple (Id;t)) of the Master dataset do not appear in the User dataset, and vice versa. My aim is to get Stata to merge the two tables such that every observation, both from the User dataset and from the Master dataset appear in the final table, with the relevant values for x0 and x1 (and a dot if no value is announced for either x0 or x1).
I have tried to follow the procedure given in the Stata documentation, but the option "merge 1:1 id t using User dataset" does not provide the right output, since the values for the column x_0 are misplaced; I have tried to reiterate the procedure with some small tables such as those provided here, and it does work; however, when trying to achieve the same result with my true datasets, which have much more rows, I do not seem to be able to achieve the intended table.
Would someone be so kind as to help me with this issue?
Many thanks in advance
GD
This is my first post on this forum, so I am looking forward to collaborate with the Stata community.
I am currently encountering a slight problem; I would like to merge two panel data sets, whose structure is the following:
Master dataset:
Id | t | X1 |
1 | 2000 | 8 |
2 | 2000 | 2543 |
3 | 2001 | 24325468 |
3 | 2002 | 34582467 |
3 | 2003 | 423568 |
8 | 2005 | 585858 |
10 | 2010 | 634648 |
Id | t | X0 |
1 | 2008 | 1313 |
2 | 2000 | 5869 |
3 | 2010 | 89677 |
8 | 2001 | 8754657 |
8 | 2005 | 5858 |
18 | 2010 | 589697979 |
I have tried to follow the procedure given in the Stata documentation, but the option "merge 1:1 id t using User dataset" does not provide the right output, since the values for the column x_0 are misplaced; I have tried to reiterate the procedure with some small tables such as those provided here, and it does work; however, when trying to achieve the same result with my true datasets, which have much more rows, I do not seem to be able to achieve the intended table.
Would someone be so kind as to help me with this issue?
Many thanks in advance
GD
Comment