Statalist The Stata Listserver


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

st: Reshape problem


From   "Thomas Speidel" <[email protected]>
To   <[email protected]>
Subject   st: Reshape problem
Date   Thu, 4 May 2006 11:55:37 -0600

Dear Statalisters:

I have a dataset that I need to re-organize in a long format.  
Here is a sample:

+--------------------------------------+
| id                 v1   v2   v3   v4 |
|--------------------------------------|
|  2                Sex    M    M    M |
|  3                Age   47   66   56 |
|  4           Left eye                |
|  5          Right eye    Y    Y    Y |
|  6       Lower eyelid    Y    Y    Y |
|--------------------------------------|
|  7       Upper eyelid                |
|  8    Lateral canthus                |
|  9     Medial canthus    Y    Y      |
| 10   Recurrent lesion                |
| 11     Primary lesion    Y    Y    Y |
+--------------------------------------+

There are 255 observations (v2-v256) occupying the columns.  I need each
observation to be a distinct row.  Almost all of the entries are string,
(missing means "NO"). I am having difficulties using the reshape command
to achieve my goal, possibly because of the strings.  Any suggestion on
how to approach this?  Should I create a loop to encode all variables?

Thanks for any suggestion,

Thomas

--
Thomas Speidel
Statistical Associate
Clinical Trials Unit
Tom Baker Cancer Centre
1331 - 29th Street N.W.
Calgary, AB, T2N 4N4

Tel. (403) 521-3370
Email: [email protected]

This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index