Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: changing the structure of a data set


From   Barbara Hofmann <bahof@web.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: changing the structure of a data set
Date   Tue, 09 Aug 2005 11:25:32 +0200

Hello,

hopefully someone of you can melp me with changing a dataset of the following 
structure:

(containing values of var2 by var1 and year)
year:	1991	1992	1993
----------------------------
var1
15   	8.58	8.76	9.53
16	1.01	.91	.9
17	.89	.75	.72
18	.39	.3	.3
19	.28	.23	.16
20	.52	.5	.6
21	.65	.56	.58
22	.89	1.07	.9



...into this one:

var1	year   var2
15	1991   8.58
16	1991   1.01
17	1991   .89
18	1991   .39
19	1991   .28
20	1991   .52
21	1991   .65
22	1991   .89
15	1992   8.76
16	1992   .91
17	1992   .75
18	1992   .3
19	1992   .23
20	1992   .5
21	1992   .56
22	1992   1.07
15	1993   9.53
16	1993   .9
17	1993   .72
18	1993   .3
19	1993   .16
20	1993   .6
21	1993   .58
22	1993   .9


This means that at first the new variable "year" which contains the first line 
of the data set but from the second column on must be built;
and secondly, the values stored in the third and forth column should be 
appended to the existing data set.

Thanks a lot in advance!

Barbara Hofmann
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201

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