Hi:
I am working with a dataset that looks something like this:
HHID PID MID Rel_Head Age
10 1 3 1 56
10 2 . 2 48
10 3 . 7 75
10 4 . 8 80
10 5 2 6 18
10 6 2 6 16
10 7 3 5 52
10 8 3 5 49
12 1 . 1 25
12 2 . 2 24
where HHID is household identifier; PID is member identifier within each household; MID is the identifier for the mother; Rel_Head is the relationship to the head of the household (it's 1 if individual is head; 2 if they are spouse of head; 6 if child of head; 8 if father of head and so on).
For instance, in the above dataset, PID-5 and 6 are children of 1 and 2 in household 10.
I want to construct two variables from this dataset:
1. The number of children for each mother in the household;
2. The age at first birth for each mother. In other words, difference between her age and her oldest offspring's age.
Basically, I want to have two variables corresponding to the last two columns below:
HHID PID MID Rel_Head Age N_children Age_f_birth
10 1 3 1 56
10 2 . 2 48 2 30
10 3 . 7 75 2 19
10 4 . 8 80
10 5 2 6 18
10 6 2 6 16
10 7 3 5 52
10 8 3 5 49
12 1 . 1 25
12 2 . 2 24
Any help would be immensely appreciated! Thank you!
Related Posts with Find number of children, age at birth for women using identifiers
Out of Sample/Scope Prediction with CII need some help to get more details for Examples 2&3 to work (page 7 in regress postestimation …
Syntax of cross-classified multilevel modelDear Statalist, I need to analyze data with complex structures. My data set consists of individuals…
Smoothing Kaplan Meier CurvesHello STATA Community, I am a new STATA user and I am trying to compute smooth Kaplan Meier curves.…
ppml: Number of regressors excludedHi, I am using the PPML estimator but I am not really sure what does it mean?: "Number of regresso…
Adding time variablesHi, I am currently working with time data. The following is the time each person spends alone on ea…
Subscribe to:
Post Comments (Atom)
0 Response to Find number of children, age at birth for women using identifiers
Post a Comment