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

st: Collapsing records


From   "Eric G. Wruck" <[email protected]>
To   [email protected]
Subject   st: Collapsing records
Date   Fri, 21 Feb 2003 13:01:20 -0500

I have student rosters for a school over many years.  Not surprisingly, siblings often go to the same school.  I want to go from student-level records to a family record.

An example of what I currently have is:


           last       first    id   fam_id   yrs  
116.    Carlson     Finnian    40       92     9  
117.    Carlson        Liam    41       92    10  
544.    Petroff   Alexander   654      420     3  
545.    Petroff     Allison   589      420     4  
546.    Petroff        Kate   590      420     4  

What I would like is something like:

fam_id	last1	first1 		id1	yrs1	last2 	first2	id2	yrs2	etc.
92	Carlson	Finnian		40	9	Carlson	Liam	41	10
420	Petroff	Alexander	654	3	Petroff	Allison	589	4


I played around with -reshape wide- unsuccessfully.  I created a variable for the i() parameter which was simply an index ranging from 1 to the number of kids in the family, but couldn't figure out what j() should be.  

Any help would be greatly appreciated.

Thanks,

Eric

-- 

===================================================

       Eric G. Wruck
       Econalytics
       2535 Sherwood Road
       Columbus, OH  43209

       ph:      614.231.5034
       fax:     614.231.5039
       eFax:    419.730.7809
       eMail:   [email protected]
       website: http://www.econalytics.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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index