!Sorry in advance, I haven't been able to extract the exact example with dataex!
Stata 18 on Windows
My sample looks roughly like that:
People living in the same household as their partner get assigned their partner's PersonalID as PartnerID. As shown in the example above, some people (107) have an assigned partner (108) but their partner isn't part of this sample (PersonalID 108 is missing). I now want to drop all the people whose partners are not part of my dataset (in this case: dropping 107).
I have tried things like:
gen partner_missing = missing(PartnerID)
drop if partner_missing
drop partner_missing
but this only drops observations like 113 which are not supposed to be dropped.
What else can I try to yield my desired result?
Thanks in advance!
Stata 18 on Windows
My sample looks roughly like that:
Year | HouseholdID | PersonalID | PartnerID |
2005 | 10 | 107 | 108 |
2006 | 10 | 107 | 108 |
2007 | 10 | 107 | 108 |
2008 | 10 | 107 | 108 |
2009 | 10 | 107 | 108 |
2005 | 11 | 113 | - |
I have tried things like:
gen partner_missing = missing(PartnerID)
drop if partner_missing
drop partner_missing
but this only drops observations like 113 which are not supposed to be dropped.
What else can I try to yield my desired result?
Thanks in advance!
Comment