Hello STATALIST community,

I am a desperate student at the University of Konstanz in Germany and I am currently writing my master thesis. I hope to get some help this way. Unfortunately, I am not that familiar with Stata.
As you can see in the picture, persons can either be a child or a father (=head). I have given a household identifier (hid), person identifier (pid), survey year (syear) and the relationship to household head (d11105) as variables. It can happen that a child later has his own household and becomes a household head.
I would like to keep only those individuals/children (+ keep their fathers) in which they first appeared as a child and disregard those adult children which create their own family later.

I tried to find a solution on the Internet, but did not find any. I am very grateful if you can help me. I am sure there is a simple solution, but I know too little about STATA.

Best regards from Germany