Date: Mon, 28 Feb 2005 00:59:19 -0500
From: "Kakatua Kutta" <[email protected]>
Subject: st: data manipulation problem
Dear stata maestros,
I have a following data set
nh pid sid age educ
1 1 2 34 3
1 2 1 29 2
1 3 . 21 2
1 4 . 27 1
2 1 3 44 12
2 2 . 23 9
2 3 1 31 11
2 4 . 19 2
2 5 . 27 3
.
.
.
nh is the household identification no and pid is individual identification
within each household. Sid is the spouse identification no for those
people who are married within a household. So for nh=1, it means pid 1 and
2 are married to each other and for nh=2, pid 1 and 3 are married to each
other.
What I want to do is to make a datasets consisting of household members
married to each other. That is, in the new data set I want to keep , for
nh=1, pid 1 and 2 and for nh=2, pid 1 and 3. So what I am trying to find
that for each nh, take those pid for which sid equals pid from others
observations.
Is there anyway to do it rather than going through each observation
individually?
------------