You could try the following:
rename id fam
gen obsnum=_n
rename obsnum by
rename birthyrofchild byr
reshape wide by, i(fam) j(byr)
----- Original Message -----
From: [email protected]
Date: Monday, December 31, 2007 8:06 am
Subject: st: reorganize data
To: [email protected]
> Hello,
>
> I am a STATA-beginner, but since I need it for my diploma, I am
> forced to
> send you a question.
>
> My data is organized as follows... for example:
>
> ID BirthYearOfChild
> 2 1973
> 2 1975
> 3 1954
> 4 1965
> 4 1967
> 4 1969
>
> My problem is, that the identifyers appear more than once. I want to
>
> restructure the data to get it into the
> form:
>
> ID BirthYearOfFirstChild BirthYearOfSecondChild
> BirthYearofThirdChild
> 2 1973 1975
>
> .
> 3 1954 .
>
> .
> 4 1965 1967
>
> 1969
>
> I tried with some If and ForEach and ForValues commands, but they all
> don�t
> work.
> I would be really very grateful if anyone could give me an advice how
> to
> reorganize the data.
>
> Thank you all for reading,
> Markus.
>
>
>
>
>
>
> *
> * 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/
*
* 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/