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: Reshape from long to wide and attaching Labels contained in a Variable.


From   "Stefan Schöftner" <[email protected]>
To   [email protected]
Subject   st: Reshape from long to wide and attaching Labels contained in a Variable.
Date   Thu, 29 Aug 2013 23:11:07 +0200 (CEST)

 

Hello Dear Statalist subscribers,
 
As a fellow reader, i now dare to post my first own question.
I got actually a rather simple looking issue but it seems not doable also i worked on it for several days
 
I got a  sample of a Data file looking something like this:
 
Long FORM:
ID´s repeat therefor i need the wide form.
 
Obs.          ID       Title             Amount                Code
1              xxx       abc              12345                   yy1
2              xxx       bcd              54321                   yy2
3              xxx       cda              43215                   yy3
4              xxx       acb              32154                   yy4
5              xxx       cad              21543                   yy4
 
 
I use a reshape command to bring this dataset into wide form
so it looks like this
 
Wide Form:
 
Obs.          ID        yy1      yy2    yy3    yy4      yy5        Title       

1              xxx                                                  abc
2              xxx                                                  bcd
3              xxx      AMOUNT ---------------------Amount          cda
4              xxx                                                  acb
5              xxx                                                  cad
 
What I now desire, would be that the variable "Title" be converted into  the label text for the according variables yy1-yy5-yyx.
yyx because the entire dataset consists of several 10.000 observations
The variable "code" itself would be enough for identification but since im going to work a lot more with this sample the change in Label would help me quite a bit.
 
At the current point in time i just drop "Title" and deal with the Coding.
I would really appreciate any input on how to solve this issue.
 
Best Regards and Thanks in Advance
Stefan
 

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


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