Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Reshape question


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Reshape question
Date   Thu, 4 Nov 2010 17:59:28 +0000

gen long id = _n
reshape <whatever> , i(id) j(LETTERS) string 

This may still not yield what you want. I suspect you have extra requirements on what aligns with what that don't match Stata philosophy that an observation is not just a row of your data, but a single entity. 

Nick 
[email protected] 

Charles Lee, Master of Public Policy Candidate 2011

I'm trying to reformat my data such that row observations in a single column
are filtered into separate columns. Currently, my data looks like this:

LETTERS
---------------
a
b
c
d
a
b
c
d

Now, the goal is to put similar observations (e.g. all the a's) into
separate columns.  So, in the example above, there would be four
columns, one for each letter.  Does anyone know how I can do this
systematically?


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index