Statalist


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

st: join duplicated records from one datafile


From   "Bernhard Hansen" <[email protected]>
To   <[email protected]>
Subject   st: join duplicated records from one datafile
Date   Tue, 19 Feb 2008 13:12:42 +0100

Dear statalisters

I have a data file with 2 variables and duplicates on one of these 
like:

id  var1

1    3
1    4
1    5
2    2
3    2
4    5

Now I want to turn each id into one unique record, and turning the
information on var 1 into a range of new variables so that 
I would like to end up with a data file looking like: 

id var1 var2 var 3
1  3     4     5 
2  2     .     .
3  2     .     .
4  5     .     .

Does anyone knows if it is possible?

Regards
B. Hansen

*
*   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