Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Creating values for ID variables


From   "Prabal Kr. De" <contactprabal@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Creating values for ID variables
Date   Thu, 16 Aug 2007 05:12:21 -0700 (PDT)

Hi!
  I have a household survey dataset which gives
householdid (hhid) individual id (iid) and 
corresponding ids for father and mother. Therefore the
data looks like
 
hhid	iid	fatherid	motherid 	grade_completed
1001	1	.	.	6
1001	2	.	.	5
1001	3	1	2	3
1001	4	1	2	3
1002	1	.	.	5
1002	2	.	.	6
1002	3	1	2	8
1002	4	.	.	8
1002	5	3	4	1
 
I want to create two variables: fatheredu (father's
education) and motheredu (mother's education) so that
the resulting dataset will look like
 
hhid	iid	fatherid	motherid 	grade_completed	 fatheredu
motheredu
1001	1	.	.	6		
1001	2	.	.	5		
1001	3	1	2	3	6	5
1001	4	1	2	3	6	5
1002	1	.	.	5		
1002	2	.	.	6		
1002	3	1	2	8	5	6
1002	4	.	.	8		
1002	5	3	4	1	8	8
 
Right now I am doing separately and in a long
inefficient way. Can anyone suggest a smarter way?
 Thanks in advance!
     Prabal


       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/
*
*   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