I am trying to find out the mother's birth age (delivery age) for the OLDEST CHILD in each household, but not sure how to do this in stata.
SUID: household identifier
ADDID: address id
PNUM: person number
EPNMOM: person number of mother
sample dataset:
expected output:
Thank you!
SUID: household identifier
ADDID: address id
PNUM: person number
EPNMOM: person number of mother
sample dataset:
SUID | ADDID | PNUM | SEX (1=M,2=F) | EPNMOM | AGE |
1 | 11 | 101 | 1 | . | 39 |
1 | 11 | 102 | 2 | . | 38 |
1 | 11 | 103 | 1 | 102 | 5 |
1 | 11 | 104 | 1 | 102 | 3 |
2 | 11 | 101 | 2 | . | 55 |
2 | 11 | 102 | 2 | 101 | 20 |
2 | 12 | 101 | 2 | . | 40 |
2 | 12 | 102 | 1 | . | 35 |
2 | 12 | 103 | 2 | 101 | 10 |
SUID | ADDID | PNUM | SEX (1=M,2=F) | EPNMOM | AGE | BIRTH AGE |
1 | 11 | 101 | 1 | . | 39 | . |
1 | 11 | 102 | 2 | . | 38 | 33 |
1 | 11 | 103 | 1 | 102 | 5 | . |
1 | 11 | 104 | 1 | 102 | 3 | . |
2 | 11 | 101 | 2 | . | 55 | 35 |
2 | 11 | 102 | 2 | 101 | 20 | . |
2 | 12 | 101 | 2 | . | 40 | 30 |
2 | 12 | 102 | 1 | . | 35 | . |
2 | 12 | 103 | 2 | 101 | 10 | . |
Comment