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]

Re: st: Database problem


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Database problem
Date   Fri, 7 Dec 2012 19:28:06 +0000

Punctuation was awry there:

If I understand this correctly, I would change the structure of the
data so that you have (in -reshape- terms) a -long- not -wide-
structure.


On Fri, Dec 7, 2012 at 7:22 PM, Nick Cox <[email protected]> wrote:
> If I understand this correctly, I would change the structure of the
> data so that you have (in -reshape- terms, a -long- not -wide-
> structure).
>
> Even after reversal, this is going to be very awkward to work with, so
> it's better to think of another solution.
>
> You probably have some -rename-ing to do first.
>
> Nick
>
> On Fri, Dec 7, 2012 at 7:16 PM, roland andersson <[email protected]> wrote:
>> I have data on 3574 unique patients. In the datase there are first 5
>> identification variables ,age, sex and so on. Thereafter comes a
>> nomber of variables representing observations. Each observation has
>> three columns - the sequential number of the observation, the content
>> of the observation and the date. The problem is that these observation
>> are in reverse order, ie the last observation comes first and the
>> first observation last in the row. And the number of observations for
>> each patient range from 1 to 44. Some observations have the same date
>> so they have the same sequential number. below is the data. Var 7, var
>> 10 and var 13 are the number of the observation, var 8, 11, and 14 the
>> observation (the diagnosis or intervention) and var 9, 12 and 15 the
>> date of the observation.
>>
>> I want to reverse the order so that the first observation comes in as
>> var 7 etc. I also want to merge observations with the same date with a
>> new combined content. case nr 1 below sholuld thus be 1
>> diverticulitsigmo 15930. Is this possible?
>>
>> Regards
>> Roland Andersson
>>
>>  var7 var8 var9 var10 var11 var12 var13 var14 var15
>> 1 diverticulit 15930 1 sigmo 15930
>> 1 akutiverticulit 16670 1 sigmo 16670
>> 3 akutiverticulit 17126 2 akutiverticulit 16962 1 akutiverticulit 16359
>> 2 akutiverticulit 17019 1 akutiverticulit 17019
>> 1 akutiverticulit 15831 1 resektion 15831
>> 1 akutiverticulit 16129
>> 3 ctbuk 16839 2 sigmo 16838 1 akutiverticulit 16532
>> *
>> *   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/
*
*   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