selecting cases from longitudinal database

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

selecting cases from longitudinal database

SR Millis-3
I have a longitudinal database in which patients were measured at a minimum of 1 time and a maximum of 9 times on an outcome measure.  For those patients measured multiple times, say 3 times, some may have been measured at Times 1, 2, and 3 while other were measured at Times 1, 3, and 5.

The database is in "long" format, ie, a line of data for each measurement time.

I would like to select only those patients having been measured least 3 times.  How might I do this?

Thanks in advance,

Scott Millis


Reply | Threaded
Open this post in threaded view
|

Re: selecting cases from longitudinal database

Mike
You can do this in at least two ways:
 
(1) Using NVALID
 
compute N_times=nvalid(time01 to time09).
select if  N_times01 ge 3.
[procs]
 
(2) Using NMISSING
 
Compute N_times02=nmissing(time01 to time09).
select if N_times02 lt 3.
[procs]
 
-Mike Palij
New York University
----- Original Message -----
Sent: Wednesday, August 03, 2011 4:35 PM
Subject: selecting cases from longitudinal database

I have a longitudinal database in which patients were measured at a minimum of 1 time and a maximum of 9 times on an outcome measure.  For those patients measured multiple times, say 3 times, some may have been measured at Times 1, 2, and 3 while other were measured at Times 1, 3, and 5.

The database is in "long" format, ie, a line of data for each measurement time.

I would like to select only those patients having been measured least 3 times.  How might I do this?

Thanks in advance,

Scott Millis


Reply | Threaded
Open this post in threaded view
|

Re: selecting cases from longitudinal database

Ornelas, Fermin-2
In reply to this post by SR Millis-3

How about running  a frequency by patient id then saving the frequency counts per id. Then match it back to the original data set  and from there select only those cases whose participation=3. I have done this stuff but in SAS.

 

Fermin Ornelas,

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of SR Millis
Sent: Wednesday, August 03, 2011 1:35 PM
To: [hidden email]
Subject: selecting cases from longitudinal database

 

I have a longitudinal database in which patients were measured at a minimum of 1 time and a maximum of 9 times on an outcome measure.  For those patients measured multiple times, say 3 times, some may have been measured at Times 1, 2, and 3 while other were measured at Times 1, 3, and 5.

 

The database is in "long" format, ie, a line of data for each measurement time.

 

I would like to select only those patients having been measured least 3 times.  How might I do this?

 

Thanks in advance,

 

Scott Millis

 

 



NOTICE: This e-mail (and any attachments) may contain PRIVILEGED OR CONFIDENTIAL information and is intended only for the use of the specific individual(s) to whom it is addressed. It may contain information that is privileged and confidential under state and federal law. This information may be used or disclosed only in accordance with law, and you may be subject to penalties under law for improper use or further disclosure of the information in this e-mail and its attachments. If you have received this e-mail in error, please immediately notify the person named above by reply e-mail, and then delete the original e-mail. Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: selecting cases from longitudinal database

Bruce Weaver
Administrator
In reply to this post by Mike
Hi Mike.  I think you missed Scott's point about the file having one row per time point, not multiple variables for the 9 time points.  Given the long file format, I'd use AGGREGATE (breaking on ID) to write the number of records per person (NU function) to the working data file (ADDVARIABLES mode).  Then select if that new variable GE 3.

Cheers,
Bruce


Mike Palij wrote
You can do this in at least two ways:

(1) Using NVALID

compute N_times=nvalid(time01 to time09).
select if  N_times01 ge 3.
[procs]

(2) Using NMISSING

Compute N_times02=nmissing(time01 to time09).
select if N_times02 lt 3.
[procs]

-Mike Palij
New York University
[hidden email]
  ----- Original Message -----
  From: SR Millis
  To: [hidden email] 
  Sent: Wednesday, August 03, 2011 4:35 PM
  Subject: selecting cases from longitudinal database


  I have a longitudinal database in which patients were measured at a minimum of 1 time and a maximum of 9 times on an outcome measure.  For those patients measured multiple times, say 3 times, some may have been measured at Times 1, 2, and 3 while other were measured at Times 1, 3, and 5.


  The database is in "long" format, ie, a line of data for each measurement time.


  I would like to select only those patients having been measured least 3 times.  How might I do this?


  Thanks in advance,


  Scott Millis
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: selecting cases from longitudinal database

Richard Ristow
In reply to this post by SR Millis-3
At 04:35 PM 8/3/2011, SR Millis wrote:

>I have a longitudinal database in which patients were measured at a
>minimum of 1 time and a maximum of 9 times on an outcome
>measure.  The database is in "long" format, ie, a line of data for
>each measurement time. I would like to select only those patients
>having been measured least 3 times.

As for selecting duplicate cases -- in your case, they're not
duplicates, but they are for the same patient. Assuming your patients
are identified by variable PatientID, then (untested)

AGGREGATE OUTFILE=* MODE=ADDVARIABLES
    /BREAK=PatientID
    /NMeasure 'Number of outcome measures for this patient' = NU.

Then you can select or filter on "NMeasure" as you please.

-Best wishes,
  Richard

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: selecting cases from longitudinal database

SR Millis-3
Thanks to all for your very helpful advice!

Scott Millis
 
~~~~~~~~~~~
Scott R Millis, PhD, ABPP, CStat, PStat®
Professor
Wayne State University School of Medicine
Email: [hidden email]
Email: [hidden email]
Tel: 313-993-8085