Dear all,
my panel dataset looks like this:
So If individuals are married, they often have a Partner-ID assigned. Due to some restrictions, some individuals got dropped from the dataset.
What I want to do know is to set the Partner-ID to missing, if the partner is not in the dataset anymore. So if there is no pid equal to the partner-id of an individual.
So for example if the individual with the pid 3456 is no longer in the dataset, I would like to set the partner-id of individual 2459 missing.
Any help would be appreciated. Thank you very much in advance.
my panel dataset looks like this:
pid | year | married | partid |
100 | 1990 | 1 | 101 |
100 | 1991 | 1 | 101 |
100 | 1992 | 1 | 101 |
2459 | 1990 | 0 | . |
2459 | 1991 | 1 | 3456 |
2459 | 1992 | 1 | 3456 |
59345 | 1990 | 1 | 79856 |
59345 | 1991 | 1 | 79856 |
59345 | 1992 | 0 | . |
So If individuals are married, they often have a Partner-ID assigned. Due to some restrictions, some individuals got dropped from the dataset.
What I want to do know is to set the Partner-ID to missing, if the partner is not in the dataset anymore. So if there is no pid equal to the partner-id of an individual.
So for example if the individual with the pid 3456 is no longer in the dataset, I would like to set the partner-id of individual 2459 missing.
Any help would be appreciated. Thank you very much in advance.
Comment