Identifying values within a variable

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

Identifying values within a variable

vstirkey

I have a file that contains millions of cases. Each consumer has an id number and consumers may have 1 case or many cases. There is a variable that describes the funding source- Medicaid or Non Medicaid. Each case contains one funding source code; a consumer may have all the same code, or they may have both codes.  I need to know if a consumer was Medicaid, Non-Medicaid, or both. The only function I can see that approximates this is count occurrences of values within a case, but that wouldn’t work in this problem because we are in effect grouping the cases by consumer ID and identifying values within that group.

Here is an example of 2 consumers:

Consumer1         1

Consumer1         1

Consumer1         1

Consumer1         2

Consumer1         1

Consumer2         2

Consumer2         2

Consumer2         2

I want to get output that shows that Consumer 1 had both sources of funding; also, that Consumer 2 had only 1.

Any guidance you can offer would be greatly appreciated.

 

 

Vicki L. Stirkey

OMHSAS l Bureau of Quality Management and Data Review

112 East Azalea Drive l Hbg PA  17110

Phone: 717.705.8198 l Fax: 717.772.6737

www.dpw.state.pa.us

 

Reply | Threaded
Open this post in threaded view
|

Re: Identifying values within a variable

Jon K Peck
Run AGGREGATE (Data > Aggregate) breaking on the ID variable.  Chose min and max as the aggregating functions and choose to add the new values back to the original dataset or make a new dataset.  Then computing whether the two values are the same or different gives you your answer.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        "Stirkey, Vicki" <[hidden email]>
To:        [hidden email],
Date:        12/23/2013 06:04 AM
Subject:        [SPSSX-L] Identifying values within a variable
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I have a file that contains millions of cases. Each consumer has an id number and consumers may have 1 case or many cases. There is a variable that describes the funding source- Medicaid or Non Medicaid. Each case contains one funding source code; a consumer may have all the same code, or they may have both codes.  I need to know if a consumer was Medicaid, Non-Medicaid, or both. The only function I can see that approximates this is count occurrences of values within a case, but that wouldn’t work in this problem because we are in effect grouping the cases by consumer ID and identifying values within that group.
Here is an example of 2 consumers:
Consumer1         1
Consumer1         1
Consumer1         1
Consumer1         2
Consumer1         1
Consumer2         2
Consumer2         2
Consumer2         2
I want to get output that shows that Consumer 1 had both sources of funding; also, that Consumer 2 had only 1.
Any guidance you can offer would be greatly appreciated.
 
 
Vicki L. Stirkey
OMHSAS l Bureau of Quality Management and Data Review
112 East Azalea Drive l Hbg PA  17110
Phone: 717.705.8198 l Fax: 717.772.6737
www.dpw.state.pa.us