Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re. Generating a multiple birth indicator in a large data set


From   "roger webb" <[email protected]>
To   [email protected]
Subject   st: re. Generating a multiple birth indicator in a large data set
Date   Fri, 16 Jul 2004 09:52:18 +0100

Dear Statalist,

I have a large vital statistics register of all births in Denmark and 
have the following variables:

Offspring ID ('offid')
Birth order ('bo')
Maternal ID ('mothid')

If the birth order number is duplicated within a sibling set, multiple 
births are indicated. Eg. for 3 mothers (101,102,103):

mothid		bo		offid
101			1		1
101			2		2
102			1		3
102			1		4
103			1		5
103			1		6
103			1		7

Mother 101 has two singleton offspring (1,2), mother 102 has twins 
(offspring 3,4) and mother 103 has triplets (offspring 5-7).

I'd like to add a multiplicity indicator ('multi') to the data set, i.e.:

mothid		bo		offid		multi
101			1		1			1
101			2		2			1
102			1		3			2
102			1		4			2
103			1		5			3
103			1		6			3
103			1		7			3

I've looked at the 'egen' command but can't see anything suitable. 
Does anyone have any ideas as to how I can write a Stata 
command to generate this variable?

Many thanks in advance,

Roger Webb
University of Manchester (UK)


 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index