[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Collapsing records
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.
Eric G. Wruck
2535 Sherwood Road
Columbus, OH 43209
* For searches and help try: