LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 14 Mar 2005 17:17:35 +0100
Reply-To:     Victor Tarrago <vtarrago@acziona.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Victor Tarrago <vtarrago@acziona.com>
Subject:      Re: INDIVIDUALS (CASES) IN MULTIPLE LINES
Comments: To: Richard Ristow <wrristow@mindspring.com>
In-Reply-To:  <5.1.0.14.2.20050311143028.00a713c0@pop.mindspring.com>
Content-Type: text/plain; charset="iso-8859-1"

Thank you to Gene Magin, Hillel Vardi and Richard Ristow for your help.

For each treatment we have common variables (description of treatment, cost, date, doctor...). That means that we can have a line for each patient, but the number of variables will depend on the number of treatments. We're going to use varstocases.

Kind Regards,

Victor Tarragó

-----Mensaje original----- De: Richard Ristow [mailto:wrristow@mindspring.com] Enviado el: viernes, 11 de marzo de 2005 20:42 Para: Victor Tarrago; SPSSX-L@LISTSERV.UGA.EDU Asunto: Re: INDIVIDUALS (CASES) IN MULTIPLE LINES

At 10:38 AM 3/11/2005, Victor Tarrago wrote:

>Each individual in [our] file has as many lines, as medical treatments >he have received and we would like to have this multiple lines as a >single one. There is no variable with the number of treatments >received. For each line we have the patient code and not all >individuals have the same number of lines. The treatment received is a >string variable.

This is what AGGREGATE was invented for. To get the number of treatments for each patient, load your file as the working file, and run (not tested)

AGGREGATE OUTFILE=* /BREAK = PT_CODE /N_TREAT 'No. of treatments for patient' = N.

FORMATS N_TREAT(F3) /* Not required */.

(This destroys the working file; make sure your file is in a permanent .SAV file, first.)

You'll have two variables in your working file: PT_CODE and N_TREAT. You'll have one record for each PT_CODE, and the number of treatments that patient received.

When you make a single line per patient, what else would you like in it? Number of treatments of a certain kind? Dates of first and last treatment? Or what? Most such problems can be solved with AGGREGATE, but the question, first, is, what do you want?


Back to: Top of message | Previous page | Main SPSSX-L page