Date: Fri, 30 May 2008 11:15:49 +0200
Reply-To: Carsten Pauck <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Carsten Pauck <firstname.lastname@example.org>
Subject: Re: Longitudinal data / data processing
Content-Type: text/plain; charset=ISO-8859-1
another idea is to restructure the dataset. As a result you have one
row for every patient (=id):
You start with the data:
ID DATE SYMA SYMB SYMC
1,00 01-MAY-1998 ,00 1,00 ,00
1,00 01-MAY-1999 1,00 2,00 ,00
1,00 01-MAY-2000 2,00 2,00 3,00
2,00 02-MAY-1998 ,00 ,00 ,00
2,00 02-MAY-1999 2,00 3,00 2,00
3,00 03-MAY-1998 2,00 4,00 2,00
3,00 03-MAY-1999 2,00 2,00 3,00
3,00 03-MAY-2000 1,00 2,00 3,00
3,00 03-MAY-2001 1,00 ,00 ,00
And you restructure the data: Data -> restructure ... which will generate
SORT CASES BY id .
/ID = id
/GROUPBY = VARIABLE .
Which will transform the data in switching vars to cases.
syma.1 syma.2 syma.3 syma.4 symb.1 etc
1,00 01-MAY-1998 01-MAY-1999 01-MAY-2000 . ,00
1,00 2,00 . 1,00 2,00 2,00 . ,00 ,00 3,00 .
2,00 02-MAY-1998 02-MAY-1999 . .
,00 2,00 . . ,00 3,00 . . ,00 2,00 . .
3,00 03-MAY-1998 03-MAY-1999 03-MAY-2000 03-MAY-2001 2,00 2,00
1,00 1,00 4,00 2,00 2,00 ,00 2,00 3,00 3,00 ,00
Now it is possible to analyse the data in the way you are used to (count,
2008/5/29 Jennifer Thompson <email@example.com>:
> Dear SPSSers,
> I wonder if anyone could suggest a solution to this data processing /
> manipulation problem?
> *Background and description of data*
> I am working on a longitudinal data set that consists of psychiatric
> symptoms, coded on a 5-point (0-4) scale. The data set is 'long' with a
> separate case for each observation. Participants were interviewed
> and the number of observations per participant is variable. Each
> participant has a unique ID code (combination of letters and digits) and a
> date is recorded for each interview.
> I would like to know how many participants have had a score of 2 or more
> (this being the accepted criterion for the symptom being present) for each
> symptom at _any_ of the interviews during the follow up period.
> So, I guess I want to create a new variable (e.g. 'ever_panic') that is
> coded '1' if a given symptom (e.g. 'panic') is scored 2 or higher for
> of the interviews with an individual participant. Or alternatively, to
> generate an output that lists the ID codes and whether or not the symptom
> was present at any time?
> I can only think of tortuously long-winded ways to do this, which is not
> ideal because the process will need to be repeated for 30+ items! Can any
> suggest a solution? I am using SPSS 14.
> I would be very grateful for any suggestions! Thanks for reading.
> Best wishes,
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
For a list of commands to manage subscriptions, send the command