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 service setting- state hospital, Treatment Facility, Community setting, jail, other inpatient setting. Each case contains one service setting code; a consumer may have all the same code, or they may have up to 5 codes. I need to know which setting a consumer received treatment in. Is there a way to create a variable, possibly by recoding to a new variable, that will show all the different service settings, up to 5? Here is an example of 2 consumers: 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 |
Administrator
|
Please see AGGREGATE, CASESTOVARS and you can follow up with MULT RESPONSE or CONCAT function?
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?" |
In reply to this post by vstirkey
I am sorry, I don't understand the response. Aggregate- use Consumer as break, then what? I am not familiar with the other functions at all. Is there a document you can refer me to?
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Tuesday, April 22, 2014 2:31 PM To: [hidden email] Subject: Re: Dsiplaying mulitple values Please see AGGREGATE, CASESTOVARS and you can follow up with MULT RESPONSE or CONCAT function? Stirkey, Vicki-2 wrote > 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 service setting- state hospital, Treatment > Facility, Community setting, jail, other inpatient setting. Each case > contains one service setting code; a consumer may have all the same > code, or they may have up to 5 codes. I need to know which setting a > consumer received treatment in. Is there a way to create a variable, > possibly by recoding to a new variable, that will show all the > different service settings, up to 5? Here is an example of 2 consumers: > Consumer1 1 > Consumer1 1 > Consumer1 3 > Consumer1 2 > Consumer1 1 > Consumer2 2 > Consumer2 2 > Consumer2 2 > I want to get output that shows that Consumer 1 had 3 different > treatment settings, 132 ; also, that Consumer 2 had only service setting code 2. > 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<http://www.dpw.state.pa.us> ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Dsiplaying-mulitple-values-tp5725594p5725597.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 |
Administrator
|
Well, think about AGGREGATE and your data and what you need to get.
Should be pretty obvious.
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?" |
In reply to this post by vstirkey
At 01:35 PM 4/22/2014, Stirkey, Vicki wrote:
>I have a file in which each consumer has an id number. Consumers may >have 1 case or many cases. There is a variable that describes the >service setting- state hospital, Treatment Facility, Community >setting, jail, other inpatient setting. Each case contains one >service setting code; a consumer may have all the same code, or they >may have up to 5 codes. I need to know which setting a consumer >received treatment in. Is there a way to create a variable, possibly >by recoding to a new variable, that will show all the different >service settings, up to 5? Here is an example of 2 consumers: |-----------------------------|---------------------------| |Output Created |23-APR-2014 17:40:42 | |-----------------------------|---------------------------| [TestData] Consumer Setting Consumer1 1 Consumer1 1 Consumer1 3 Consumer1 2 Consumer1 1 Consumer2 2 Consumer2 2 Consumer2 2 Number of cases read: 8 Number of cases listed: 8 The following gets *close* to what you want. It lists all the settings in which the consumer received service, not setting a maximum of 5; and it has a separate variable for each setting, rather than creating a string. (But that could be done readily, from the output of this code.) DATASET DECLARE SiteSmry. AGGREGATE OUTFILE=SiteSmry /BREAK=Consumer Setting /Inst 'Instances at this setting' = NU. DATASET ACTIVATE SiteSmry WINDOW=FRONT. LIST. List |-----------------------------|---------------------------| |Output Created |23-APR-2014 17:40:43 | |-----------------------------|---------------------------| [SiteSmry] Consumer Setting Inst Consumer1 1 3 Consumer1 2 1 Consumer1 3 1 Consumer2 2 3 Number of cases read: 4 Number of cases listed: 4 CASESTOVARS /ID = Consumer /RENAME = Setting=Stg /DROP = Inst /GROUPBY = VARIABLE . Cases to Variables |-----------------------------|---------------------------| |Output Created |23-APR-2014 17:40:43 | |-----------------------------|---------------------------| [SiteSmry] [Generated Variables and Processing Statistics omitted] LIST. List |-----------------------------|---------------------------| |Output Created |23-APR-2014 17:40:43 | |-----------------------------|---------------------------| [SiteSmry] Consumer Stg.1 Stg.2 Stg.3 Consumer1 1 2 3 Consumer2 2 . . Number of cases read: 2 Number of cases listed: 2 ============================= APPENDIX: Test data, and code (not saved separately) ============================= NEW FILE. DATA LIST LIST/ Consumer Setting (A10, F2). BEGIN DATA Consumer1 1 Consumer1 1 Consumer1 3 Consumer1 2 Consumer1 1 Consumer2 2 Consumer2 2 Consumer2 2 END DATA. DATASET NAME TestData WINDOW=FRONT. LIST. DATASET DECLARE SiteSmry. AGGREGATE OUTFILE=SiteSmry /BREAK=Consumer Setting /Inst 'Instances at this setting' = NU. DATASET ACTIVATE SiteSmry WINDOW=FRONT. LIST. CASESTOVARS /ID = Consumer /RENAME = Setting=Stg /DROP = Inst /GROUPBY = VARIABLE . LIST. ===================== 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 |
Free forum by Nabble | Edit this page |