Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Identifying subfamilies (2nd+ marriages) within records of families

From   Anna Reimondos <>
Subject   st: Identifying subfamilies (2nd+ marriages) within records of families
Date   Thu, 2 Feb 2012 09:53:50 +1100


I have a dataset of families which looks something like this:

The first variable is a family id, then there is a registration
number, and a variable identifying whether the person is the wife,
husband or child.
In the example below there are two families. In the first family there
is a wife, husband and kids. In the second family the woman has had 2
marriages. In the first she had 2 children, and in the second marriage
she had one child. What I would like to do is create a variable called
'familynum' which will number the different families within the main

NB: There is no registration or familynum for the woman.

     family   reg        person        familynum
	1         		Wife	(1)	
	1	693		Husband(2)	1
	1	693		Child	(3)	        1	
	1	693		Child	(3)	        1
	2			Wife	(1)		
	2	542		Husband(2)	1
	2	542		Child	(3)	        1
	2	542		Child	(3)	        1
	2	879		Husband(2)	2
	2	879		Child	(3)        	2

I have done similar things before, and I know the solution is probably
very obvious...but I am having a blonde moment.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index