Database with the same participant ID on multiple case lines... how to fix/work with this?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Database with the same participant ID on multiple case lines... how to fix/work with this?

Max Gunther
Hi all,

I just started working with a database which is generally organized like
this:

http://spreadsheets.google.com/pub?key=pVzA8GEBSfgMyIofwW5gFAA

Instead of making multiple time variables per case line they put each time
point on a separate case line. If I wish to look at for example the number
of times a patient met diagnostic criteria I would have to transpose (via
copy and paste) each time point horizontally into a new variable. That is
extremely time consuming. Is there an easier way to do this?

Thanks for your time!
Max
Reply | Threaded
Open this post in threaded view
|

Re: Database with the same participant ID on multiple case lines... how to fix/work with this?

Maguin, Eugene
Max,

One word: Casestovars.

More words: Look at the Casestovars command in either help or syntax
reference. I think the writeup needs more examples and is kind of confusing
but I think that is the command to use. Come back to the list if you have
questions.

Gene Maguin
Reply | Threaded
Open this post in threaded view
|

Re: Database with the same participant ID on multiple lines

Richard Ristow
In reply to this post by Max Gunther
At 05:36 PM 8/15/2007, Max Gunther wrote:

>I just started working with a database which is generally organized
>like
>this:

Sub_ID_Num      ClinCond        Date

         1                2      08/24/04
         1                2      08/25/04
         1                2      08/26/04
         1                2      08/27/04
         1                2      08/28/04
         1                2      08/29/04
         1                2      08/30/04
         1                2      08/31/04

>Instead of making multiple time variables per case line they put each
>time point on a separate case line. If I wish to look at for example
>the number of times a patient met diagnostic criteria I would have to
>transpose (via copy and paste) each time point horizontally into a new
>variable. Is there an easier way?

See Gene Maguin's post: CASESTOVARS does what you want. Alternatively,
look at AGGREGATE, which could likely give you what you want without
transposing at all, with logic that might well be simpler.