Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: How to stack data horizontally?


From   Olivia Bacha <oliviabacha@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to stack data horizontally?
Date   Wed, 22 Aug 2012 00:15:42 +0100

Hello all,

I have the data organized as follows:

id	v1	v2	v3	v4
1	1	2	3	4
1	5	6	7	8
1	9	10	11	12
2	13	14	15	16
2	17	18	19	20
2	21	22	23	24


And want it to be:

v1	v2	v3	v4	v5	v6	v7	v8	v9	v10	v11	v12
1	2	3	4	5	6	7	8	9	10	11	12
13	14	15	16	17	18	19	20	21	22	23	24

That is, I want to stack it horizontally by  id.
Does anyone know how to do that?

Thanks in advance.
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index