Currently I'm working with a dataset that contains several waves with various ID's (mothers) and their corresponding children, who also have their own ID's .
Each ID of the mother is matched in one line with the ID of their children.
However, In the dataset also contains mothers who have more than ohne child, so one ID can be potentially matched with several CIDs (As you can see in the example).
Wave | ID | CID |
1 | 21001 | 1001 |
1 | 21001 | 1002 |
This command should say (by sense)
"gen children if there is more than one CID hat belongs to the ID"
Hopefully you got my point and can help me figure this out.
Thanks in advance!
0 Response to Matching several observations via new variable
Post a Comment