Statalist


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

Re: st: join duplicated records from one datafile


From   "Peter Dijkstra" <ptdijkstra@gmx.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: join duplicated records from one datafile
Date   Tue, 19 Feb 2008 13:34:26 +0100

Right now you have the data in a so-called "long format" and you want to turn it into "wide format". This can be done using the -reshape- command.
Cheers, Peter
-------- Original-Nachricht --------
> Datum: Tue, 19 Feb 2008 13:12:42 +0100
> Von: "Bernhard Hansen" <Bernhard.Hansen@STAB.RM.DK>
> An: statalist@hsphsun2.harvard.edu
> Betreff: st: join duplicated records from one datafile

> 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
-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.web.de/de/entertainment/games/free
*
*   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