How to follow a group of cases from one file to another?

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

How to follow a group of cases from one file to another?

cbomasterstudent
I have 6 files each containing about 5 million cases. I want to follow a specific group from one file to another and troughout the 6 files. How do I begin? Every case has its own id-number which is the same in every file.
Reply | Threaded
Open this post in threaded view
|

Re: How to follow a group of cases from one file to another?

Maguin, Eugene
Use the match files command along with the In subcommand and then select out the set of id numbers you are interested in following.

Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of cbomasterstudent
Sent: Friday, September 21, 2012 4:52 AM
To: [hidden email]
Subject: How to follow a group of cases from one file to another?

I have 6 files each containing about 5 million cases. I want to follow a specific group from one file to another and troughout the 6 files. How do I begin? Every case has its own id-number which is the same in every file.



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-follow-a-group-of-cases-from-one-file-to-another-tp5715203.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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

=====================
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: How to follow a group of cases from one file to another?

Arthur Kramer
In reply to this post by cbomasterstudent
It may not be the most elegant way, but if you have a field in each file that identifies the date the file was created, you can sequentially merge the files using the individuals' id's as a key field, saving the date field as you go along. If you don't have the date field it is easily created with a "compute" statement and/or an "if" statement

Arthur Kramer


"Believe half of what you see, and none of what you hear."

B.Strong
N.Whitfield



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of cbomasterstudent
Sent: Friday, September 21, 2012 4:52 AM
To: [hidden email]
Subject: How to follow a group of cases from one file to another?

I have 6 files each containing about 5 million cases. I want to follow a
specific group from one file to another and troughout the 6 files. How do I
begin? Every case has its own id-number which is the same in every file.



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-follow-a-group-of-cases-from-one-file-to-another-tp5715203.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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

=====================
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: How to follow a group of cases from one file to another?

cbomasterstudent
In reply to this post by Maguin, Eugene
That's the problem, I don't know exactly which id numbers I'm looking for. What I want to do is to find a certain group and then use the id numbers to find the same group in the next file. Every file is for a different year and every id number is a person, with about 5 million people it's going to take forever to find the exact id numbers I'm looking for.
Reply | Threaded
Open this post in threaded view
|

Re: How to follow a group of cases from one file to another?

David Marso
Administrator
"What I want to do is to find a certain group and then use the id numbers to find the same group in the next file. "
You need to define the criteria for what you mean by 'find a certain group'.  
Other than that once you define that properly use MATCH FILES as others have suggested.
If you can't adequately specify/define -what you mean by 'find a certain group'-
Then sorry, can't help you (in fact nobody can)!
cbomasterstudent wrote
That's the problem, I don't know exactly which id numbers I'm looking for. What I want to do is to find a certain group and then use the id numbers to find the same group in the next file. Every file is for a different year and every id number is a person, with about 5 million people it's going to take forever to find the exact id numbers I'm looking for.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: How to follow a group of cases from one file to another?

cbomasterstudent
In each file I have the entire population of a country from year to year (2004 to 2006). All the files contain information about dispensed drugs. If I'm looking at the use of i.e. analgesics; how can I locate those who were using analgesic in 2004, in the following years? Say I wanted to see whether they still were using analgesics or if they had stopped.
Reply | Threaded
Open this post in threaded view
|

Re: How to follow a group of cases from one file to another?

Maguin, Eugene
So pick a year, one single year. Now pick a drug or drug class. Post the code that you would use to find people who were prescribed that drug/drug class that year. As I understand the problem, the solution is trivially simple. But maybe there are things that haven't been explained yet.

Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of cbomasterstudent
Sent: Tuesday, September 25, 2012 7:46 AM
To: [hidden email]
Subject: Re: How to follow a group of cases from one file to another?

In each file I have the entire population of a country from year to year
(2004 to 2006). All the files contain information about dispensed drugs. If I'm looking at the use of i.e. analgesics; how can I locate those who were using analgesic in 2004, in the following years? Say I wanted to see whether they still were using analgesics or if they had stopped.



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-follow-a-group-of-cases-from-one-file-to-another-tp5715203p5715251.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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

=====================
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: How to follow a group of cases from one file to another?

Art Kendall
In reply to this post by cbomasterstudent
try something like this untested approach.

In the 2004  data
*create a new variable say "Analgesic2004".
compute analgesic2004 = somecondition.
* create a file of case id using analgesics in 2004.
temporary.
select if analgesic2004.
dataset declare users.
aggregate outfile =users /break = casedid
 /times = nu(analgesic2004).

match files
 /file= data2005 /in= in2005
  /table= users
 /by caseid.
dataset name data2005a.
* get rid of 2005 cases that did NOT use in 2004.
dataset activate data2005a.
select if in2005.
execute.
*match the 2006 data to the table of case ids.
match files
 /file= data2006 /in= in2006
...

HTH
Art Kendall
Social Research Consultants
On 9/25/2012 7:46 AM, cbomasterstudent wrote:
In each file I have the entire population of a country from year to year
(2004 to 2006). All the files contain information about dispensed drugs. If
I'm looking at the use of i.e. analgesics; how can I locate those who were
using analgesic in 2004, in the following years? Say I wanted to see whether
they still were using analgesics or if they had stopped.



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-follow-a-group-of-cases-from-one-file-to-another-tp5715203p5715251.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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


===================== 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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to follow a group of cases from one file to another?

David Marso
Administrator
In reply to this post by cbomasterstudent
Given the info you have been provided by others (hint MATCH FILES!!! )
What is preventing you from doing this?  As Gene stated it is trivially simple!
Try writing some code and report back if it doesn't work.
NOTE:  You should visit the TABLE subcommand of MATCH FILES in the FM.  It will certainly make things simpler.  **ALSO** Your files MUST be sorted on the ID variables!.  
You should also try the describe the data structure in more detail if this advice does not suffice.
--
cbomasterstudent wrote
In each file I have the entire population of a country from year to year (2004 to 2006). All the files contain information about dispensed drugs. If I'm looking at the use of i.e. analgesics; how can I locate those who were using analgesic in 2004, in the following years? Say I wanted to see whether they still were using analgesics or if they had stopped.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: How to follow a group of cases from one file to another?

David Marso
Administrator
In reply to this post by Art Kendall
Probably something along those lines except I would omit TEMP and just go for it.
MATCH FILES
  / TABLE=users
  / FILE= data2005 /in= in2005
  / FILE= data2006 /in= in2006
  / FILE= data2007 /in= in2007
  / FILE= data2008 /in= in2008
  / FILE= data2009 /in= in2009 ....
  / BY caseid.
---
Art Kendall wrote
try something like this
        untested approach.
       
        In the 2004  data
        *create a new variable say "Analgesic2004".
        compute analgesic2004 = somecondition.
        * create a file of case id using analgesics in 2004.
        temporary.
        select if analgesic2004.
        dataset declare users.
        aggregate outfile =users /break = casedid
         /times = nu(analgesic2004).
       
        match files
         /file= data2005 /in= in2005
          /table= users
         /by caseid.
        dataset name data2005a.
        * get rid of 2005 cases that did NOT use in 2004.
        dataset activate data2005a.
        select if in2005.
        execute.
      *match the 2006 data to the table of case
        ids.
      match files
           /file= data2006 /in= in2006
        ...
       
        HTH
     
      Art Kendall
Social Research Consultants
      On 9/25/2012 7:46 AM, cbomasterstudent wrote:
   
   
      In each file I have the entire population of a country from year to year
(2004 to 2006). All the files contain information about dispensed drugs. If
I'm looking at the use of i.e. analgesics; how can I locate those who were
using analgesic in 2004, in the following years? Say I wanted to see whether
they still were using analgesics or if they had stopped.



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-follow-a-group-of-cases-from-one-file-to-another-tp5715203p5715251.html 
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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


   
   
 


=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: How to follow a group of cases from one file to another?

Rich Ulrich
In reply to this post by cbomasterstudent
If you want to create a WIDE version of the data, with one ID
per person and several years of data, you could use CASESTOVARS.

Then you merely Select to use only the ones with data for the
year in question, if Year is the reason for selecting.  Or else
match against your file of desired IDs.

--
Rich Ulrich

> Date: Tue, 25 Sep 2012 00:48:50 -0700

> From: [hidden email]
> Subject: Re: How to follow a group of cases from one file to another?
> To: [hidden email]
>
> That's the problem, I don't know exactly which id numbers I'm looking for.
> What I want to do is to find a certain group and then use the id numbers to
> find the same group in the next file. Every file is for a different year and
> every id number is a person, with about 5 million people it's going to take
> forever to find the exact id numbers I'm looking for.
>
>