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

st: Creation of family id


From   Juan Baron <juan.baron@anu.edu.au>
To   statalist@hsphsun2.harvard.edu
Subject   st: Creation of family id
Date   Wed, 30 Nov 2005 09:49:06 +1100

Dear Stata Users:

Suppose I have the following data

id p_id1 p_id2 pid3
1 . . .
2 6 7 9
3 8 . .
4 5 1 .
5 . . .
6 . . .
7 . . .
8 . . .
9 . . .
10 5 . .

where id is a unique id for each indiviidual and p_id#'s the id of the parent (in the real data I have more than 3 pid variables)

I want to create a family id in the most efficient way. My solution to this problem involves looping over observations, and because of that
it takes a long time. That wouldn't be a problem if my data contained only a few observations, but that is not the case.

Can anybody suggest more efficient ways to do this task? I was wondering also, how about using MATA?

Thanks,

Juan

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index