Recoding for more than one result

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

Recoding for more than one result

Judy Harmon
Hello,
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I
tried this code, but it's not working.  Can someone help me with this? I'd
like to add the different diagnoses together to get multiple diagnoses.
Thanks.
USE ALL.
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =
1000000000000000
  & 18 = 100000000000000000 & 19 = 1000000000000000000).
VALUE LABELS Axis1Cat1new
  2 '10'
  3 '100'
  4 '1000'
  6 '10000'
  9 '100000000'
  10 '1000000000'
  12 '100000000000'
  14 '10000000000000'
  16 '1000000000000000'
  18 '100000000000000000'
  19 '1000000000000000000'.
EXECUTE.
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .

=====================
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: Recoding for more than one result

Art Kendall
Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:
Hello,
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I
tried this code, but it's not working.  Can someone help me with this? I'd
like to add the different diagnoses together to get multiple diagnoses.
Thanks.
USE ALL.
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =
1000000000000000
  & 18 = 100000000000000000 & 19 = 1000000000000000000).
VALUE LABELS Axis1Cat1new
  2 '10'
  3 '100'
  4 '1000'
  6 '10000'
  9 '100000000'
  10 '1000000000'
  12 '100000000000'
  14 '10000000000000'
  16 '1000000000000000'
  18 '100000000000000000'
  19 '1000000000000000000'.
EXECUTE.
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .

=====================
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: Recoding for more than one result

David Marso
Administrator
In reply to this post by Judy Harmon
Judy,
It is not terribly obvious what you are doing here.  What is the nature of the variable(s) you are working with.  What are you attempting to create from the starting point.
Probably need to describe what you are beginning with and the result you desire.
I'll bet Filter_$ ends up with a value of 0 for every case.
FALSE & FALSE = FALSE = 0 ( ie. 2 !~10 neither does 3 = 100 etc...).
SPSS probably parses your command just fine but results in 'unexpected' results.
--------
Look at RECODE for a possible solution.
CAVEAT!  I might be wrong, but I don't believe SPSS will store 100000000000000000 and 1000000000000000000 (I believe it can store about 16 significant digits in a numeric variable).
You should probably go with base 2 rather than base 10.
0=0,1=1,2=2,3=4,4=8, 5=16 etc.
say 1,2,4 ->1+2+8=11.
        2,5  ->    2+6=18.
Judy Harmon wrote
Hello,
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I
tried this code, but it's not working.  Can someone help me with this? I'd
like to add the different diagnoses together to get multiple diagnoses.
Thanks.
USE ALL.
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =
1000000000000000
  & 18 = 100000000000000000 & 19 = 1000000000000000000).
VALUE LABELS Axis1Cat1new
  2 '10'
  3 '100'
  4 '1000'
  6 '10000'
  9 '100000000'
  10 '1000000000'
  12 '100000000000'
  14 '10000000000000'
  16 '1000000000000000'
  18 '100000000000000000'
  19 '1000000000000000000'.
EXECUTE.
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .

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

Automatic reply: Recoding for more than one result

Kelly Vander Ley

I will be out of the office from June 13th-June 17th returning on June 20th.  If you need immediate assistance please call the main office number 503/223-8248 or 800/788-1887 and the receptionist will ensure that I get the message.  Thank you. Kelly

 

Reply | Threaded
Open this post in threaded view
|

Re: Recoding for more than one result

John F Hall
In reply to this post by Judy Harmon

You could use COUNT to see how many diagnoses any one patient has and MULT RESPONSE to generate a crosstab of diagnosis by diagnosis (for any two) or even a three-way table.  However the binary route suggested by David seems a sensible approach.

 

 

John F Hall

 

[hidden email]  

www.surveyresearch.weebly.com

 

 

 

 

 

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Judy Harmon
Sent: 10 June 2011 22:40
To: [hidden email]
Subject: Recoding for more than one result

 

Hello,

I'm trying to recode some diagnoses, where there are multiple diagnoses.  I

tried this code, but it's not working.  Can someone help me with this? I'd

like to add the different diagnoses together to get multiple diagnoses.

Thanks.

USE ALL.

COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000

& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =

1000000000000000

  & 18 = 100000000000000000 & 19 = 1000000000000000000).

VALUE LABELS Axis1Cat1new

  2 '10'

  3 '100'

  4 '1000'

  6 '10000'

  9 '100000000'

  10 '1000000000'

  12 '100000000000'

  14 '10000000000000'

  16 '1000000000000000'

  18 '100000000000000000'

  19 '1000000000000000000'.

EXECUTE.

VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

FORMAT filter_$ (f1.0).

FILTER BY filter_$.

EXECUTE .

 

=====================

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: Recoding for more than one result

Art Kendall
In reply to this post by Art Kendall
Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:
Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.




-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:
Hello,


I'm trying to recode some diagnoses, where there are multiple diagnoses.  I


tried this code, but it's not working.  Can someone help me with this? I'd


like to add the different diagnoses together to get multiple diagnoses.


Thanks.


USE ALL.


COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000


& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =


1000000000000000


  & 18 = 100000000000000000 & 19 = 1000000000000000000).


VALUE LABELS Axis1Cat1new


  2 '10'


  3 '100'


  4 '1000'


  6 '10000'


  9 '100000000'


  10 '1000000000'


  12 '100000000000'


  14 '10000000000000'


  16 '1000000000000000'


  18 '100000000000000000'


  19 '1000000000000000000'.


EXECUTE.


VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.


FORMAT filter_$ (f1.0).


FILTER BY filter_$.


EXECUTE .





=====================


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

Fwd: Recoding for more than one result

Judy Harmon
In reply to this post by David Marso




-----Original Message-----
From: David Marso <[hidden email]>
To: gh1959 <[hidden email]>
Sent: Sun, Jun 12, 2011 5:45 am
Subject: Re: Recoding for more than one result

Please post this to the SPSS List.

On Fri, Jun 10, 2011 at 10:46 PM, <[hidden email]> wrote:
> What we'd like to do is see if there are patterns in diagnoses for people.
> One person may have multiple diagnoses, ex: substance abuse, mood disorder,
> etc.  The data is divided into separate variables for each person, with each
> diagnosis, ex: axis 1-1, axis 1-2, etc.  So what would be the best way to
> combine all the diagnoses for people and compare them across everyone?  I
> thought using the 100 etc. would work by separating diagnoses, and combining
> them.  Is this a better description? Thanks in advance for your help.
>
>
>
> -----Original Message-----
> From: David Marso <[hidden email]>
> To: SPSSX-L <[hidden email]>
> Sent: Fri, Jun 10, 2011 4:10 pm
> Subject: Re: Recoding for more than one result
>
> Judy,
>
>
> It is not terribly obvious what you are doing here. What is the nature of
>
>
> the variable(s) you are working with. What are you attempting to create
>
>
> from the starting point.
>
>
> Probably need to describe what you are beginning with and the result you
>
>
> desire.
>
>
> I'll bet Filter_$ ends up with a value of 0 for every case.
>
>
> FALSE & FALSE = FALSE = 0 ( ie. 2 !~10 neither does 3 = 100 etc...).
>
>
> SPSS probably parses your command just fine but results in 'unexpected'
>
>
> results.
>
>
> --------
>
>
> Look at RECODE for a possible solution.
>
>
> CAVEAT! I might be wrong, but I don't believe SPSS will store
>
>
> 100000000000000000 and 1000000000000000000 (I believe it can store about 16
>
>
> significant digits in a numeric variable).
>
>
> You should probably go with base 2 rather than base 10.
>
>
> 0=0,1=1,2=2,3=4,4=8, 5=16 etc.
>
>
> say 1,2,4 ->1+2+8=11.
>
>
> 2,5 -> 2+6=18.
>
>
>
>
>
> Judy Harmon wrote:
>
>
>>
>
>
>> Hello,
>
>
>> I'm trying to recode some diagnoses, where there are multiple diagnoses.
>
>
>> I
>
>
>> tried this code, but it's not working. Can someone help me with this? I'd
>
>
>> like to add the different diagnoses together to get multiple diagnoses.
>
>
>> Thanks.
>
>
>> USE ALL.
>
>
>> COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000
>
>
>> & 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =
>
>
>> 1000000000000000
>
>
>> & 18 = 100000000000000000 & 19 = 1000000000000000000).
>
>
>> VALUE LABELS Axis1Cat1new
>
>
>> 2 '10'
>
>
>> 3 '100'
>
>
>> 4 '1000'
>
>
>> 6 '10000'
>
>
>> 9 '100000000'
>
>
>> 10 '1000000000'
>
>
>> 12 '100000000000'
>
>
>> 14 '10000000000000'
>
>
>> 16 '1000000000000000'
>
>
>> 18 '100000000000000000'
>
>
>> 19 '1000000000000000000'.
>
>
>> EXECUTE.
>
>
>> VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
>
>
>> FORMAT filter_$ (f1.0).
>
>
>> FILTER BY filter_$.
>
>
>> EXECUTE .
>
>
>>
>
>
>> =====================
>
>
>> 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
>
>
>>
>
>
>
>
>
>
>
>
> --
>
>
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/Recoding-for-more-than-one-result-tp4477253p4477426.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
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Recoding for more than one result

Judy Harmon
In reply to this post by Art Kendall
Mr. Kendell,
I'm working on the syntax you sent me.  I've had to take some time off because of a death in the family.  I'll let you know if this syntax works for me.  In the mean time, thanks for your help!
Judy Harmon



-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result

Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:
Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.




-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:
Hello,


I'm trying to recode some diagnoses, where there are multiple diagnoses. I


tried this code, but it's not working. Can someone help me with this? I'd


like to add the different diagnoses together to get multiple diagnoses.


Thanks.


USE ALL.


COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000


& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =


1000000000000000


& 18 = 100000000000000000 & 19 = 1000000000000000000).


VALUE LABELS Axis1Cat1new


2 '10'


3 '100'


4 '1000'


6 '10000'


9 '100000000'


10 '1000000000'


12 '100000000000'


14 '10000000000000'


16 '1000000000000000'


18 '100000000000000000'


19 '1000000000000000000'.


EXECUTE.


VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.


FORMAT filter_$ (f1.0).


FILTER BY filter_$.


EXECUTE .





=====================


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: Recoding for more than one result

Judy Harmon
In reply to this post by Art Kendall
Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.






-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result

Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:
Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.




-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:
Hello,


I'm trying to recode some diagnoses, where there are multiple diagnoses. I


tried this code, but it's not working. Can someone help me with this? I'd


like to add the different diagnoses together to get multiple diagnoses.


Thanks.


USE ALL.


COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000


& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =


1000000000000000


& 18 = 100000000000000000 & 19 = 1000000000000000000).


VALUE LABELS Axis1Cat1new


2 '10'


3 '100'


4 '1000'


6 '10000'


9 '100000000'


10 '1000000000'


12 '100000000000'


14 '10000000000000'


16 '1000000000000000'


18 '100000000000000000'


19 '1000000000000000000'.


EXECUTE.


VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.


FORMAT filter_$ (f1.0).


FILTER BY filter_$.


EXECUTE .





=====================


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: Recoding for more than one result

John F Hall

Judy

 

You’ve got a / before groups.  This will cause an error.  You need

 

Mult resp groups ~~~~~

 

 

John F Hall

 

[hidden email]

www.surveyresearch.weebly.com

 

 

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 17:10
To: [hidden email]
Subject: Re: Recoding for more than one result

 

Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.

 

 

 

 

-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result

Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:

Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.

 

 

 

 

-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:

Hello,

 


 


 
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I

 


 


 
tried this code, but it's not working.  Can someone help me with this? I'd

 


 


 
like to add the different diagnoses together to get multiple diagnoses.

 


 


 
Thanks.

 


 


 
USE ALL.

 


 


 
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000

 


 


 
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =

 


 


 
1000000000000000

 


 


 
  & 18 = 100000000000000000 & 19 = 1000000000000000000).

 


 


 
VALUE LABELS Axis1Cat1new

 


 


 
  2 '10'

 


 


 
  3 '100'

 


 


 
  4 '1000'

 


 


 
  6 '10000'

 


 


 
  9 '100000000'

 


 


 
  10 '1000000000'

 


 


 
  12 '100000000000'

 


 


 
  14 '10000000000000'

 


 


 
  16 '1000000000000000'

 


 


 
  18 '100000000000000000'

 


 


 
  19 '1000000000000000000'.

 


 


 
EXECUTE.

 


 


 
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

 


 


 
FORMAT filter_$ (f1.0).

 


 


 
FILTER BY filter_$.

 


 


 
EXECUTE .

 


 


 


 


 


 
=====================

 


 


 
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: Recoding for more than one result

Judy Harmon
John,
I tried it both ways and won't work. See Art Kendell's syntax below, it has a / before groups.
Judy



-----Original Message-----
From: John F Hall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L <[hidden email]>
Sent: Mon, Jun 13, 2011 10:39 am
Subject: RE: Recoding for more than one result

Judy
 
You’ve got a / before groups.  This will cause an error.  You need
 
Mult resp groups ~~~~~
 
 
John F Hall
 
 
 
 
 
 
 
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 17:10
To: [hidden email]
Subject: Re: Recoding for more than one result
 
Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.

 
 
 
 
-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result
Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:
Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.
 
 
 
 
-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result
Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:
Hello,

 


 


 
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I

 


 


 
tried this code, but it's not working.  Can someone help me with this? I'd

 


 


 
like to add the different diagnoses together to get multiple diagnoses.

 


 


 
Thanks.

 


 


 
USE ALL.

 


 


 
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000

 


 


 
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =

 


 


 
1000000000000000

 


 


 
  & 18 = 100000000000000000 & 19 = 1000000000000000000).

 


 


 
VALUE LABELS Axis1Cat1new

 


 


 
  2 '10'

 


 


 
  3 '100'

 


 


 
  4 '1000'

 


 


 
  6 '10000'

 


 


 
  9 '100000000'

 


 


 
  10 '1000000000'

 


 


 
  12 '100000000000'

 


 


 
  14 '10000000000000'

 


 


 
  16 '1000000000000000'

 


 


 
  18 '100000000000000000'

 


 


 
  19 '1000000000000000000'.

 


 


 
EXECUTE.

 


 


 
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

 


 


 
FORMAT filter_$ (f1.0).

 


 


 
FILTER BY filter_$.

 


 


 
EXECUTE .

 


 


 


 


 


 
=====================

 


 


 
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: Recoding for more than one result

John F Hall

Judy

 

Does the autorecode bit work (I’ve never used it)?  What do the new variables look like in Data View?  Are they all numeric?  Are they all there?  Have you run freq on the separate vars? 

 

What happens if you run mult resp in binary mode?  (ie just put one value in the brackets)   Can you run the job in small bits rather than all at once?

 

Can you run a simpler job such as:

 

Mult resp groups ~ ~ ~

/freq dx

/tab dx by dx.

 

John

 

[hidden email]

www.surveyresearch.weebly.com

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 18:56
To: [hidden email]
Subject: Re: Recoding for more than one result

 

John,
I tried it both ways and won't work. See Art Kendell's syntax below, it has a / before groups.
Judy

 

 

 

-----Original Message-----
From: John F Hall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L <[hidden email]>
Sent: Mon, Jun 13, 2011 10:39 am
Subject: RE: Recoding for more than one result

Judy

 

You’ve got a / before groups.  This will cause an error.  You need

 

Mult resp groups ~~~~~

 

 

John F Hall

 

 

 

 

 

 

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 17:10
To: [hidden email]
Subject: Re: Recoding for more than one result

 

Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.

 

 

 

 

-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result

Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:

Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.

 

 

 

 

-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:

Hello,

 


 
 


 


 
 


 


 
 
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I

 


 
 


 


 
 


 


 
 
tried this code, but it's not working.  Can someone help me with this? I'd

 


 
 


 


 
 


 


 
 
like to add the different diagnoses together to get multiple diagnoses.

 


 
 


 


 
 


 


 
 
Thanks.

 


 
 


 


 
 


 


 
 
USE ALL.

 


 
 


 


 
 


 


 
 
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000

 


 
 


 


 
 


 


 
 
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =

 


 
 


 


 
 


 


 
 
1000000000000000

 


 
 


 


 
 


 


 
 
  & 18 = 100000000000000000 & 19 = 1000000000000000000).

 


 
 


 


 
 


 


 
 
VALUE LABELS Axis1Cat1new

 


 
 


 


 
 


 


 
 
  2 '10'

 


 
 


 


 
 


 


 
 
  3 '100'

 


 
 


 


 
 


 


 
 
  4 '1000'

 


 
 


 


 
 


 


 
 
  6 '10000'

 


 
 


 


 
 


 


 
 
  9 '100000000'

 


 
 


 


 
 


 


 
 
  10 '1000000000'

 


 
 


 


 
 


 


 
 
  12 '100000000000'

 


 
 


 


 
 


 


 
 
  14 '10000000000000'

 


 
 


 


 
 


 


 
 
  16 '1000000000000000'

 


 
 


 


 
 


 


 
 
  18 '100000000000000000'

 


 
 


 


 
 


 


 
 
  19 '1000000000000000000'.

 


 
 


 


 
 


 


 
 
EXECUTE.

 


 
 


 


 
 


 


 
 
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

 


 
 


 


 
 


 


 
 
FORMAT filter_$ (f1.0).

 


 
 


 


 
 


 


 
 
FILTER BY filter_$.

 


 
 


 


 
 


 


 
 
EXECUTE .

 


 
 


 


 
 


 


 
 


 


 
 


 


 
 


 


 
 
=====================

 


 
 


 


 
 


 


 
 
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
|

Fwd: Recoding for more than one result

Judy Harmon




-----Original Message-----
From: gh1959 <[hidden email]>
To: johnfhall <[hidden email]>
Sent: Mon, Jun 13, 2011 11:22 am
Subject: Re: Recoding for more than one result

John,
The auto recode worked well.  All the variables are there, and are numeric.  They were string variables.  Yes I've run frequencies on the separate variables. I'll try running the job in smaller bits as you suggest.
Thanks,
Judy




-----Original Message-----
From: John F Hall <[hidden email]>
To: gh1959 <[hidden email]>
Cc: SPSSX-L <[hidden email]>
Sent: Mon, Jun 13, 2011 11:15 am
Subject: RE: Recoding for more than one result

Judy
 
Does the autorecode bit work (I’ve never used it)?  What do the new variables look like in Data View?  Are they all numeric?  Are they all there?  Have you run freq on the separate vars? 
 
What happens if you run mult resp in binary mode?  (ie just put one value in the brackets)   Can you run the job in small bits rather than all at once?
 
Can you run a simpler job such as:
 
Mult resp groups ~ ~ ~
/freq dx
/tab dx by dx.
 
John
 
 
 
 
 
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 18:56
To: [hidden email]
Subject: Re: Recoding for more than one result
 
John,
I tried it both ways and won't work. See Art Kendell's syntax below, it has a / before groups.
Judy
 
 
 
-----Original Message-----
From: John F Hall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L <[hidden email]>
Sent: Mon, Jun 13, 2011 10:39 am
Subject: RE: Recoding for more than one result
Judy
 
You’ve got a / before groups.  This will cause an error.  You need
 
Mult resp groups ~~~~~
 
 
John F Hall
 
 
 
 
 
 
 
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 17:10
To: [hidden email]
Subject: Re: Recoding for more than one result
 
Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.
 
 
 
 
-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result
Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:
Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.
 
 
 
 
-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result
Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:
Hello,





 






 
 






 






 
 






 






 
 
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I





 






 
 






 






 
 






 






 
 
tried this code, but it's not working.  Can someone help me with this? I'd





 






 
 






 






 
 






 






 
 
like to add the different diagnoses together to get multiple diagnoses.





 






 
 






 






 
 






 






 
 
Thanks.





 






 
 






 






 
 






 






 
 
USE ALL.





 






 
 






 






 
 






 






 
 
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000





 






 
 






 






 
 






 






 
 
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =





 






 
 






 






 
 






 






 
 
1000000000000000





 






 
 






 






 
 






 






 
 
  & 18 = 100000000000000000 & 19 = 1000000000000000000).





 






 
 






 






 
 






 






 
 
VALUE LABELS Axis1Cat1new





 






 
 






 






 
 






 






 
 
  2 '10'





 






 
 






 






 
 






 






 
 
  3 '100'





 






 
 






 






 
 






 






 
 
  4 '1000'





 






 
 






 






 
 






 






 
 
  6 '10000'





 






 
 






 






 
 






 






 
 
  9 '100000000'





 






 
 






 






 
 






 






 
 
  10 '1000000000'





 






 
 






 






 
 






 






 
 
  12 '100000000000'





 






 
 






 






 
 






 






 
 
  14 '10000000000000'





 






 
 






 






 
 






 






 
 
  16 '1000000000000000'





 






 
 






 






 
 






 






 
 
  18 '100000000000000000'





 






 
 






 






 
 






 






 
 
  19 '1000000000000000000'.





 






 
 






 






 
 






 






 
 
EXECUTE.





 






 
 






 






 
 






 






 
 
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.





 






 
 






 






 
 






 






 
 
FORMAT filter_$ (f1.0).





 






 
 






 






 
 






 






 
 
FILTER BY filter_$.





 






 
 






 






 
 






 






 
 
EXECUTE .





 






 
 






 






 
 






 






 
 






 






 
 






 






 
 






 






 
 
=====================





 






 
 






 






 
 






 






 
 
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: Recoding for more than one result

Art Kendall
In reply to this post by Judy Harmon
The variable "combo" would be computable but not practical is you have 11 multiple response variables.

When you ran the the syntax as I sent it how many distinct diagnoses did you find across all 11 input variables?

Maybe you are running a different version of SPSS, did you get the error when you ran the syntax I posted?


does "(2,6) match what you saw on the auto recode?  Did you have a total of 6 diagnoses across all 11 variables?
Or should the "6" be another number? "(2,6)" means that for each variable values from and including 2 and up to and including 6 are  to be considered valid.


Did you in fact have 11 possible diagnoses that had yes/no in each variable for Axis1Cat1 to Axis1Cat11? I.e., multiple dichotomies rather than multiple responses which were many-valued?

When you look at the data view are num1 to num11 in columns right next to each other?

Art Kendall
Social Research Consultants

On 6/13/2011 11:09 AM, [hidden email] wrote:
Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.






-----Original Message-----
From: Art Kendall [hidden email]
To: gh1959 [hidden email]; SPSSX-L post [hidden email]
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result

Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:
Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.




-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:
Hello,








I'm trying to recode some diagnoses, where there are multiple diagnoses.  I








tried this code, but it's not working.  Can someone help me with this? I'd








like to add the different diagnoses together to get multiple diagnoses.








Thanks.








USE ALL.








COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000








& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =








1000000000000000








  & 18 = 100000000000000000 & 19 = 1000000000000000000).








VALUE LABELS Axis1Cat1new








  2 '10'








  3 '100'








  4 '1000'








  6 '10000'








  9 '100000000'








  10 '1000000000'








  12 '100000000000'








  14 '10000000000000'








  16 '1000000000000000'








  18 '100000000000000000'








  19 '1000000000000000000'.








EXECUTE.








VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.








FORMAT filter_$ (f1.0).








FILTER BY filter_$.








EXECUTE .

















=====================








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
===================== 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: Recoding for more than one result

David Marso
Administrator
I propose that AGGREGATE would be a very simple way to address this.
Assuming each of the 11 are dichotomies coded 0,1 (If not then make it so!).
Let's say they are called D1 ... D11 and are contiguous in the file.
COMPUTE NRESP=SUM(D1 TO D11).
AGGREGATE OUTFILE *
                / BREAK D1 TO D11
                / Npattern=N
                / NResp=MAX(NRESP).
SORT CASES BY NRESP(A) NPattern (D).
LIST.


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: Recoding for more than one result

John F Hall
In reply to this post by Judy Harmon

Judy

 

You used AUTORECODE syntax to create 11 new variables NUM1 TO NUM11, each of which can have values from 1 (missing) to 22 indicating grouped diagnoses.

 

autorecode variables=Axis1Cat1 to Axis1Cat11
/into num1 to num11
/group
/print.

You sent me some sample data to look at and I have produced some syntax (tested) which may help to solve your problem. 

 

I managed to get you a COUNT and MULT RESPONSE with:

 

count disorders = num1 to num11 (2 thru 22) .

var lab 'Number of disorders' .

print format num1 to num11 disorders (f2.0) .

freq disorders .

 

 

disorders

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

0

2

1.0

1.0

1.0

1

2

1.0

1.0

2.1

2

20

10.4

10.4

12.5

3

56

29.2

29.2

41.7

4

49

25.5

25.5

67.2

5

36

18.8

18.8

85.9

6

13

6.8

6.8

92.7

7

11

5.7

5.7

98.4

8

1

.5

.5

99.0

9

1

.5

.5

99.5

11

1

.5

.5

100.0

Total

192

100.0

100.0

 

 

 

mult resp

 groups types 'Types of disorder'  (num1 to num11 (2,22))

/var disorders (1,11)

/freq types

/tab types by types  disorders  .

 

 

types Frequencies

 

Responses

Percent of Cases

N

Percent

types Types of disordera

2 Cognitive DIsorder NOS

2

.3%

1.1%

3 Adjustment Disorder

22

2.9%

11.6%

4 Anxiety Disorder

24

3.1%

12.6%

5 Behavior Disorder

174

22.6%

91.6%

6 Childhood/Adolescent Disorder

1

.1%

.5%

7 Childhood/Adolscent Disorder

1

.1%

.5%

8 Conduct Disorder

30

3.9%

15.8%

9 Eating Disorder

2

.3%

1.1%

10 Fetishism

1

.1%

.5%

11 Learning Disorder/Disabilities

1

.1%

.5%

12 Learning Disorders/Disabilities

48

6.2%

25.3%

13 Mood Disorder

71

9.2%

37.4%

14 Neglect of child

4

.5%

2.1%

15 Personality Change Due to

1

.1%

.5%

16 Physical Abuse of child

8

1.0%

4.2%

17 Psychotic Disorder

5

.7%

2.6%

18 Sexual Abuse of child

9

1.2%

4.7%

19 Sexual Disorder

1

.1%

.5%

20 Sleep Disorder

3

.4%

1.6%

21 Substance Use Disorder

321

41.7%

168.9%

22 V diagnosis

40

5.2%

21.1%

Total

769

100.0%

404.7%

a. Group

 

 

types*types Crosstabulation

 

types Types of disordera

Total

2 Cognitive DIsorder NOS

3 Adjustment Disorder

4 Anxiety Disorder

5 Behavior Disorder

6 Childhood/Adolescent Disorder

7 Childhood/Adolscent Disorder

8 Conduct Disorder

9 Eating Disorder

10 Fetishism

11 Learning Disorder/Disabilities

12 Learning Disorders/Disabilities

13 Mood Disorder

14 Neglect of child

15 Personality Change Due to

16 Physical Abuse of child

17 Psychotic Disorder

18 Sexual Abuse of child

19 Sexual Disorder

20 Sleep Disorder

21 Substance Use Disorder

22 V diagnosis

types Types of disordera

2 Cognitive DIsorder NOS

Count

2

0

0

3

0

0

0

0

0

0

0

1

0

0

0

1

0

0

0

3

0

2

3 Adjustment Disorder

Count

0

22

1

20

1

0

3

1

0

0

5

1

0

0

0

0

0

0

1

39

4

22

4 Anxiety Disorder

Count

0

1

24

21

0

0

8

0

0

0

8

15

1

0

1

1

2

1

1

42

5

24

5 Behavior Disorder

Count

3

20

21

180

1

1

27

2

1

1

45

61

4

1

7

5

7

1

3

289

36

174

6 Childhood/Adolescent Disorder

Count

0

1

0

1

1

0

0

1

0

0

0

0

0

0

0

0

0

0

0

1

1

1

7 Childhood/Adolscent Disorder

Count

0

0

0

1

0

1

1

0

0

0

0

1

0

0

0

0

0

0

0

3

0

1

8 Conduct Disorder

Count

0

3

8

27

0

1

30

0

0

0

8

14

1

0

0

1

3

0

0

51

10

30

9 Eating Disorder

Count

0

1

0

2

1

0

0

2

0

0

1

0

0

0

0

0

0

0

0

3

1

2

10 Fetishism

Count

0

0

0

1

0

0

0

0

1

0

0

0

0

0

0

0

0

0

0

1

1

1

11 Learning Disorder/Disabilities

Count

0

0

0

1

0

0

0

0

0

1

0

0

0

0

0

0

0

0

0

3

0

1

12 Learning Disorders/Disabilities

Count

0

5

8

45

0

0

8

1

0

0

60

19

1

0

4

2

3

3

0

86

11

48

13 Mood Disorder

Count

1

1

15

61

0

1

14

0

0

0

19

77

1

0

2

2

6

1

0

118

15

71

14 Neglect of child

Count

0

0

1

4

0

0

1

0

0

0

1

1

4

1

2

1

2

0

0

9

0

4

15 Personality Change Due to

Count

0

0

0

1

0

0

0

0

0

0

0

0

1

1

1

0

0

0

0

3

0

1

16 Physical Abuse of child

Count

0

0

1

7

0

0

0

0

0

0

4

2

2

1

8

0

3

1

0

13

6

8

17 Psychotic Disorder

Count

1

0

1

5

0

0

1

0

0

0

2

2

1

0

0

5

1

0

0

7

2

5

18 Sexual Abuse of child

Count

0

0

2

7

0

0

3

0

0

0

3

6

2

0

3

1

9

0

0

11

6

9

19 Sexual Disorder

Count

0

0

1

1

0

0

0

0

0

0

3

1

0

0

1

0

0

1

0

3

0

1

20 Sleep Disorder

Count

0

1

1

3

0

0

0

0

0

0

0

0

0

0

0

0

0

0

3

5

1

3

21 Substance Use Disorder

Count

3

39

42

289

1

3

51

3

1

3

86

118

9

3

13

7

11

3

5

669

56

321

22 V diagnosis

Count

0

4

5

36

1

0

10

1

1

0

11

15

0

0

6

2

6

0

1

56

50

40

Total

Count

2

22

24

174

1

1

30

2

1

1

48

71

4

1

8

5

9

1

3

321

40

190

Percentages and totals are based on respondents.

a. Group

 

 

To produce MULT RESPONSE tables for more than three or four levels is very complex to analyse, so I looked at an alternative solution.

 

It’s a bit cumbersome and I’m sure other listers will think of something more elegant.  The problem was that the data for num1 to num11 were not entered in ascending order of code value, so I needed to find a workaround.  Basically I needed 22 new variables to represent the values 1 to 22 (including your 1 = missing), recode them to binary if > = 1 and then generate a variable with unique values (ie 22 digits in binary) by multiplying each successive variable by increasing factors of 10, 100, 1000, etc and adding them together so that the resulting value uniquely describes all combinations found.  Your use of value 1 for missing caused a few logical problems, but here’s what I eventually came up with (tested and working)

 

count

  d1 = num1 to num11 (1)

/d2 =  num1 to num11 (2)

/d3  = num1 to num11 (3)

/d4 =  num1 to num11 (4)

/d5 =  num1 to num11 (5)

/d6 =  num1 to num11 (6)

/d7 =  num1 to num11 (7)

/d8 =  num1 to num11 (8)

/d9 =  num1 to num11 (9)

/d10 =  num1 to num11 (10)

 /d11 =  num1 to num11 (11)

 /d12 =  num1 to num11 (12)

 /d13 =  num1 to num11 (13)

 /d14 =  num1 to num11 (14)

 /d15 =  num1 to num11 (15)

 /d16 =  num1 to num11 (16)

 /d17 =  num1 to num11 (17)

 /d18 =  num1 to num11 (18)

 /d19 =  num1 to num11 (19)

/d20 =  num1 to num11 (20)

/d21 =  num1 to num11 (21)

/d22 =  num1 to num11 (22) .

 

recode d1 to d22 (2 thru hi = 1).

 

mult resp groups d  (d1 to d22 (1))

/freq d .

freq d1 to d22 .

 

compute e1 = d1 .

do repeat

               a = d2 to d22

/b = 1 to 21

/e = e2 to e22 .

compute e = a * 10 **b .

end repeat .

 

compute profile = sum (e1 to e22) .

format e1 to e22 profile (f25.0) .

 

freq e1 to e22 profile .

 

 

 

In this table, the first digit for Profile represents a blank diagnosis; all other values represent unique combinations of diagnoses, but I’ll leave it you to count the digits and work out what they are!

 

 

profile

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

1

2

1.0

1.0

1.0

10001

2

1.0

1.0

2.1

10010001

1

.5

.5

2.6

100000010001

1

.5

.5

3.1

100000010101

1

.5

.5

3.6

1000000010001

2

1.0

1.0

4.7

1100000010001

2

1.0

1.0

5.7

10001000000010012

1

.5

.5

6.3

100000000000000000000

5

2.6

2.6

8.9

100000000000000020000

57

29.7

29.7

38.5

100000000000010010000

7

3.6

3.6

42.2

100000000010000000000

1

.5

.5

42.7

100000000100000000000

17

8.9

8.9

51.6

100000000100100010000

1

.5

.5

52.1

100000001000000000000

5

2.6

2.6

54.7

100000001000000010000

23

12.0

12.0

66.7

100000001000010000000

6

3.1

3.1

69.8

100000001000011000000

1

.5

.5

70.3

100000001100000000000

5

2.6

2.6

72.9

100000001100000020000

2

1.0

1.0

74.0

100000001100010010000

2

1.0

1.0

75.0

100001000000000020000

1

.5

.5

75.5

100001010000000010000

1

.5

.5

76.0

100001110000000010000

1

.5

.5

76.6

100010000000010010000

1

.5

.5

77.1

100010001000000010000

1

.5

.5

77.6

100100000000010010000

1

.5

.5

78.1

100100001000000000000

1

.5

.5

78.6

100100001100010010000

1

.5

.5

79.2

100100011000010010000

1

.5

.5

79.7

100110010100000010000

1

.5

.5

80.2

101001001100000020000

1

.5

.5

80.7

110000000000000020000

2

1.0

1.0

81.8

1000000000000010000000

1

.5

.5

82.3

1000101000000000000000

1

.5

.5

82.8

1100000000000000000000

5

2.6

2.6

85.4

1100000000000010000000

3

1.6

1.6

87.0

1100000000000100100000

1

.5

.5

87.5

1100000000001000000000

1

.5

.5

88.0

1100000000100000100000

2

1.0

1.0

89.1

1100000000100010000000

3

1.6

1.6

90.6

1100000001000000000000

9

4.7

4.7

95.3

1100000001000010000000

1

.5

.5

95.8

1100000001100000000000

1

.5

.5

96.4

1100000001100010000000

1

.5

.5

96.9

1100001000000000000000

1

.5

.5

97.4

1100010000100000000000

1

.5

.5

97.9

1100100001000000000000

1

.5

.5

98.4

1100101000000000000000

1

.5

.5

99.0

1100101001100000000000

1

.5

.5

99.5

1110000000000000000000

1

.5

.5

100.0

Total

192

100.0

100.0

 

 

Hope this helps.

 

 

John F Hall

 

[hidden email]

www.surveyresearch.weebly.com

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 17:10
To: [hidden email]
Subject: Re: Recoding for more than one result

 

Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.

 

 

 

 

-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result

Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:

Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.

 

 

 

 

-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:

Hello,

 


 


 
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I

 


 


 
tried this code, but it's not working.  Can someone help me with this? I'd

 


 


 
like to add the different diagnoses together to get multiple diagnoses.

 


 


 
Thanks.

 


 


 
USE ALL.

 


 


 
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000

 


 


 
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =

 


 


 
1000000000000000

 


 


 
  & 18 = 100000000000000000 & 19 = 1000000000000000000).

 


 


 
VALUE LABELS Axis1Cat1new

 


 


 
  2 '10'

 


 


 
  3 '100'

 


 


 
  4 '1000'

 


 


 
  6 '10000'

 


 


 
  9 '100000000'

 


 


 
  10 '1000000000'

 


 


 
  12 '100000000000'

 


 


 
  14 '10000000000000'

 


 


 
  16 '1000000000000000'

 


 


 
  18 '100000000000000000'

 


 


 
  19 '1000000000000000000'.

 


 


 
EXECUTE.

 


 


 
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

 


 


 
FORMAT filter_$ (f1.0).

 


 


 
FILTER BY filter_$.

 


 


 
EXECUTE .

 


 


 


 


 


 
=====================

 


 


 
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
|

Recoding for more than one result

John F Hall
In reply to this post by Judy Harmon

Before everyone jumps on me, here’s a much shorter (tested) solution to the second part of my previous posting, to generate 22 dummy variables on the way to a new variable with values for unique combinations of diagnoses. 

 

do repeat

   p = d1 to d22

/q= 1 to 22 .

count p = num1 to num11 (q) .

recode p (2 thru hi = 1) .

end repeat .

 

mult resp groups

 d  (d1 to d22 (1))

/freq d .

 

compute e1 = d1 .

do repeat

   a = d2 to d22

/b = 1 to 21

/e = e2 to e22 .

compute e = a * 10 **b .

end repeat .

 

compute profile = sum (e1 to e22) .

format e1 to e22 profile (f25.0) .

 

freq e1 to e22 profile .

 

 

John F Hall

 

[hidden email]

www.surveyresearch.weebly.com

 

 

 

From: John F Hall [mailto:[hidden email]]
Sent: 18 June 2011 15:18
To: '[hidden email]'
Cc: '[hidden email]'
Subject: RE: Recoding for more than one result

 

Judy

 

You used AUTORECODE syntax to create 11 new variables NUM1 TO NUM11, each of which can have values from 1 (missing) to 22 indicating grouped diagnoses.

 

autorecode variables=Axis1Cat1 to Axis1Cat11
/into num1 to num11
/group
/print.

You sent me some sample data to look at and I have produced some syntax (tested) which may help to solve your problem. 

 

I managed to get you a COUNT and MULT RESPONSE with:

 

count disorders = num1 to num11 (2 thru 22) .

var lab 'Number of disorders' .

print format num1 to num11 disorders (f2.0) .

freq disorders .

 

 

disorders

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

0

2

1.0

1.0

1.0

1

2

1.0

1.0

2.1

2

20

10.4

10.4

12.5

3

56

29.2

29.2

41.7

4

49

25.5

25.5

67.2

5

36

18.8

18.8

85.9

6

13

6.8

6.8

92.7

7

11

5.7

5.7

98.4

8

1

.5

.5

99.0

9

1

.5

.5

99.5

11

1

.5

.5

100.0

Total

192

100.0

100.0

 

 

 

mult resp

 groups types 'Types of disorder'  (num1 to num11 (2,22))

/var disorders (1,11)

/freq types

/tab types by types  disorders  .

 

 

types Frequencies

 

Responses

Percent of Cases

N

Percent

types Types of disordera

2 Cognitive DIsorder NOS

2

.3%

1.1%

3 Adjustment Disorder

22

2.9%

11.6%

4 Anxiety Disorder

24

3.1%

12.6%

5 Behavior Disorder

174

22.6%

91.6%

6 Childhood/Adolescent Disorder

1

.1%

.5%

7 Childhood/Adolscent Disorder

1

.1%

.5%

8 Conduct Disorder

30

3.9%

15.8%

9 Eating Disorder

2

.3%

1.1%

10 Fetishism

1

.1%

.5%

11 Learning Disorder/Disabilities

1

.1%

.5%

12 Learning Disorders/Disabilities

48

6.2%

25.3%

13 Mood Disorder

71

9.2%

37.4%

14 Neglect of child

4

.5%

2.1%

15 Personality Change Due to

1

.1%

.5%

16 Physical Abuse of child

8

1.0%

4.2%

17 Psychotic Disorder

5

.7%

2.6%

18 Sexual Abuse of child

9

1.2%

4.7%

19 Sexual Disorder

1

.1%

.5%

20 Sleep Disorder

3

.4%

1.6%

21 Substance Use Disorder

321

41.7%

168.9%

22 V diagnosis

40

5.2%

21.1%

Total

769

100.0%

404.7%

a. Group

 

 

types*types Crosstabulation

 

types Types of disordera

Total

2 Cognitive DIsorder NOS

3 Adjustment Disorder

4 Anxiety Disorder

5 Behavior Disorder

6 Childhood/Adolescent Disorder

7 Childhood/Adolscent Disorder

8 Conduct Disorder

9 Eating Disorder

10 Fetishism

11 Learning Disorder/Disabilities

12 Learning Disorders/Disabilities

13 Mood Disorder

14 Neglect of child

15 Personality Change Due to

16 Physical Abuse of child

17 Psychotic Disorder

18 Sexual Abuse of child

19 Sexual Disorder

20 Sleep Disorder

21 Substance Use Disorder

22 V diagnosis

types Types of disordera

2 Cognitive DIsorder NOS

Count

2

0

0

3

0

0

0

0

0

0

0

1

0

0

0

1

0

0

0

3

0

2

3 Adjustment Disorder

Count

0

22

1

20

1

0

3

1

0

0

5

1

0

0

0

0

0

0

1

39

4

22

4 Anxiety Disorder

Count

0

1

24

21

0

0

8

0

0

0

8

15

1

0

1

1

2

1

1

42

5

24

5 Behavior Disorder

Count

3

20

21

180

1

1

27

2

1

1

45

61

4

1

7

5

7

1

3

289

36

174

6 Childhood/Adolescent Disorder

Count

0

1

0

1

1

0

0

1

0

0

0

0

0

0

0

0

0

0

0

1

1

1

7 Childhood/Adolscent Disorder

Count

0

0

0

1

0

1

1

0

0

0

0

1

0

0

0

0

0

0

0

3

0

1

8 Conduct Disorder

Count

0

3

8

27

0

1

30

0

0

0

8

14

1

0

0

1

3

0

0

51

10

30

9 Eating Disorder

Count

0

1

0

2

1

0

0

2

0

0

1

0

0

0

0

0

0

0

0

3

1

2

10 Fetishism

Count

0

0

0

1

0

0

0

0

1

0

0

0

0

0

0

0

0

0

0

1

1

1

11 Learning Disorder/Disabilities

Count

0

0

0

1

0

0

0

0

0

1

0

0

0

0

0

0

0

0

0

3

0

1

12 Learning Disorders/Disabilities

Count

0

5

8

45

0

0

8

1

0

0

60

19

1

0

4

2

3

3

0

86

11

48

13 Mood Disorder

Count

1

1

15

61

0

1

14

0

0

0

19

77

1

0

2

2

6

1

0

118

15

71

14 Neglect of child

Count

0

0

1

4

0

0

1

0

0

0

1

1

4

1

2

1

2

0

0

9

0

4

15 Personality Change Due to

Count

0

0

0

1

0

0

0

0

0

0

0

0

1

1

1

0

0

0

0

3

0

1

16 Physical Abuse of child

Count

0

0

1

7

0

0

0

0

0

0

4

2

2

1

8

0

3

1

0

13

6

8

17 Psychotic Disorder

Count

1

0

1

5

0

0

1

0

0

0

2

2

1

0

0

5

1

0

0

7

2

5

18 Sexual Abuse of child

Count

0

0

2

7

0

0

3

0

0

0

3

6

2

0

3

1

9

0

0

11

6

9

19 Sexual Disorder

Count

0

0

1

1

0

0

0

0

0

0

3

1

0

0

1

0

0

1

0

3

0

1

20 Sleep Disorder

Count

0

1

1

3

0

0

0

0

0

0

0

0

0

0

0

0

0

0

3

5

1

3

21 Substance Use Disorder

Count

3

39

42

289

1

3

51

3

1

3

86

118

9

3

13

7

11

3

5

669

56

321

22 V diagnosis

Count

0

4

5

36

1

0

10

1

1

0

11

15

0

0

6

2

6

0

1

56

50

40

Total

Count

2

22

24

174

1

1

30

2

1

1

48

71

4

1

8

5

9

1

3

321

40

190

Percentages and totals are based on respondents.

a. Group

 

 

To produce MULT RESPONSE tables for more than three or four levels is very complex to analyse, so I looked at an alternative solution.

 

It’s a bit cumbersome and I’m sure other listers will think of something more elegant.  The problem was that the data for num1 to num11 were not entered in ascending order of code value, so I needed to find a workaround.  Basically I needed 22 new variables to represent the values 1 to 22 (including your 1 = missing), recode them to binary if > = 1 and then generate a variable with unique values (ie 22 digits in binary) by multiplying each successive variable by increasing factors of 10, 100, 1000, etc and adding them together so that the resulting value uniquely describes all combinations found.  Your use of value 1 for missing caused a few logical problems, but here’s what I eventually came up with (tested and working)

 

count

  d1 = num1 to num11 (1)

/d2 =  num1 to num11 (2)

/d3  = num1 to num11 (3)

/d4 =  num1 to num11 (4)

/d5 =  num1 to num11 (5)

/d6 =  num1 to num11 (6)

/d7 =  num1 to num11 (7)

/d8 =  num1 to num11 (8)

/d9 =  num1 to num11 (9)

/d10 =  num1 to num11 (10)

 /d11 =  num1 to num11 (11)

 /d12 =  num1 to num11 (12)

 /d13 =  num1 to num11 (13)

 /d14 =  num1 to num11 (14)

 /d15 =  num1 to num11 (15)

 /d16 =  num1 to num11 (16)

 /d17 =  num1 to num11 (17)

 /d18 =  num1 to num11 (18)

 /d19 =  num1 to num11 (19)

/d20 =  num1 to num11 (20)

/d21 =  num1 to num11 (21)

/d22 =  num1 to num11 (22) .

 

recode d1 to d22 (2 thru hi = 1).

 

mult resp groups d  (d1 to d22 (1))

/freq d .

freq d1 to d22 .

 

compute e1 = d1 .

do repeat

               a = d2 to d22

/b = 1 to 21

/e = e2 to e22 .

compute e = a * 10 **b .

end repeat .

 

compute profile = sum (e1 to e22) .

format e1 to e22 profile (f25.0) .

 

freq e1 to e22 profile .

 

 

 

In this table, the first digit for Profile represents a blank diagnosis; all other values represent unique combinations of diagnoses, but I’ll leave it you to count the digits and work out what they are!

 

 

profile

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

1

2

1.0

1.0

1.0

10001

2

1.0

1.0

2.1

10010001

1

.5

.5

2.6

100000010001

1

.5

.5

3.1

100000010101

1

.5

.5

3.6

1000000010001

2

1.0

1.0

4.7

1100000010001

2

1.0

1.0

5.7

10001000000010012

1

.5

.5

6.3

100000000000000000000

5

2.6

2.6

8.9

100000000000000020000

57

29.7

29.7

38.5

100000000000010010000

7

3.6

3.6

42.2

100000000010000000000

1

.5

.5

42.7

100000000100000000000

17

8.9

8.9

51.6

100000000100100010000

1

.5

.5

52.1

100000001000000000000

5

2.6

2.6

54.7

100000001000000010000

23

12.0

12.0

66.7

100000001000010000000

6

3.1

3.1

69.8

100000001000011000000

1

.5

.5

70.3

100000001100000000000

5

2.6

2.6

72.9

100000001100000020000

2

1.0

1.0

74.0

100000001100010010000

2

1.0

1.0

75.0

100001000000000020000

1

.5

.5

75.5

100001010000000010000

1

.5

.5

76.0

100001110000000010000

1

.5

.5

76.6

100010000000010010000

1

.5

.5

77.1

100010001000000010000

1

.5

.5

77.6

100100000000010010000

1

.5

.5

78.1

100100001000000000000

1

.5

.5

78.6

100100001100010010000

1

.5

.5

79.2

100100011000010010000

1

.5

.5

79.7

100110010100000010000

1

.5

.5

80.2

101001001100000020000

1

.5

.5

80.7

110000000000000020000

2

1.0

1.0

81.8

1000000000000010000000

1

.5

.5

82.3

1000101000000000000000

1

.5

.5

82.8

1100000000000000000000

5

2.6

2.6

85.4

1100000000000010000000

3

1.6

1.6

87.0

1100000000000100100000

1

.5

.5

87.5

1100000000001000000000

1

.5

.5

88.0

1100000000100000100000

2

1.0

1.0

89.1

1100000000100010000000

3

1.6

1.6

90.6

1100000001000000000000

9

4.7

4.7

95.3

1100000001000010000000

1

.5

.5

95.8

1100000001100000000000

1

.5

.5

96.4

1100000001100010000000

1

.5

.5

96.9

1100001000000000000000

1

.5

.5

97.4

1100010000100000000000

1

.5

.5

97.9

1100100001000000000000

1

.5

.5

98.4

1100101000000000000000

1

.5

.5

99.0

1100101001100000000000

1

.5

.5

99.5

1110000000000000000000

1

.5

.5

100.0

Total

192

100.0

100.0

 

 

Hope this helps.

 

 

John F Hall

 

[hidden email]

www.surveyresearch.weebly.com

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Judy Harmon
Sent: 13 June 2011 17:10
To: [hidden email]
Subject: Re: Recoding for more than one result

 

Art, I'm getting an error when I run the mult response syntax.  I have 11 different diagnoses that one could have.  So I'm wondering if the compute combo won't work either.
Here's the error I'm getting:

Warnings
Invalid variable or group name on the MULT RESPONSE FREQUENCIES subcommand. The problem may also be an incorrect use of the TO convention.
Execution of this command stops.

Here's the syntax I fitted to my data:
recode Gender ('M' = 1) ('F' = 2) into ngender.
autorecode
   variables=Axis1Cat1 to Axis1Cat11
  /into num1 to num11
  /group
  /print.
add value labels num1 to num11 1'blank'.
missing values num1 to num11 (1).
mult response /groups = dx 'set of diagnoses' (num1 to num11 (2,6))
/Variables = ngender (1,2)
/frequencies = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx/ dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx
                      /dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx 
        /dx by dx by dx by dx by dx by dx by dx by dx by dx by dx/ dx by dx by dx by dx by dx by dx by dx by dx by dx by dx by dx
/cells = all.

 

 

 

 

-----Original Message-----
From: Art Kendall <[hidden email]>
To: gh1959 <[hidden email]>; SPSSX-L post <[hidden email]>
Sent: Sat, Jun 11, 2011 6:15 am
Subject: Re: Re: Recoding for more than one result

Copy the syntax below to a new instance of SPSS. Run it.
Is this analogous to your situation?
If not how is is it different?
if so, what do you now want to do?


Art Kendall
Social Research Consultants


* make up data.
*ignore warnings about insufficient data.
data list list/name (a15)gender (a1) dx1 to dx4 (4a15).
begin data
John,M,measles,HiBP
Mary,F,anxious,paranoia
Joe,M,mumps,measles,paranoia,anxious
Sue,F,HiBP
Bill,M, paranoia, anxious
Ann, F,HiBP, measles
Chuck,M, HiBP, mumps
Doug,M, mumps, measles, paranoia, anxious
Fran,F, anxious, HiBP
Gill,M, HiBP, anxious, paranoia
end data.
numeric ngender (f1).
recode gender ('M'=1)('F'=2) INTO NGENDER.
 
autorecode
  variables= dx1 to dx4
 /into numdx1 to numdx4
 /group
 /print.
add value labels numdx1 to numdx4 1 'blank'.
missing vlaues numdx1 to numdx4 (1).
mult response /groups = dx 'set of diagnoses' (numdx1 to numdx4 (2,6))
 /VARIABLES = ngender (1,2)
 /frequencies = dx ngender
 /tables = dx by ngender /dx by dx /dx by dx by dx/ dx by dx by dx by dx
 /cells=all.

numeric combo (n4).
compute combo = 1000*numdx1 + 100*numdx2 + 10*numdx3 + 1*numdx4.
frequencies variables = combo.
string bigstring (a40).
compute bigstring = concat(
 rtrim(dx1),' + ',
 rtrim(dx2),' + ',
 rtrim(dx3),' + ',
 rtrim(dx4)).
autorecode variables = bigstring /into uniqueset /print.
frequencies variables = uniqueset.




On 2:59 PM, [hidden email] wrote:

Yes, I have multiple response codes for each individual.  If they have more than one diagnosis, then it's coded as axis 1-1, axis 1-2, axis 1-3, etc.  The most severe diagnosis is the axis 1-1, and goes from there.  They are string variables, but I recoded them to be numeric.  I'd like to know combinations of diagnoses.  Then we'd like to see if there are any trends with these diagnoses, or similarities between the individuals. 
Thanks in advance for your help.

 

 

 

 

-----Original Message-----
From: Art Kendall [hidden email]
To: SPSSX-L [hidden email]
Sent: Fri, Jun 10, 2011 3:50 pm
Subject: Re: Recoding for more than one result

Please describe your problem in more detail.

Do you have a set of multiple dichotomies? That is yes/no variables.

OR
Do you have a set of multiple response codes like {paranoia,  anxious,  high blood pressure, measles, mumps}. and people might report them in any order?
john measles, HiBP
mary anxious, paranoia
joe mumps, measles, paranoia, anxious
sue HiBP

OR
Do you have multiple records per patient with one diagnosis on each?

Are the variables numeric or string?

Are you trying to find out which diagnoses co-occur simply for counts, or will you need new variables do go into complex analyses?

Are you interested only in counts of diagnoses? Or do you want to know about combinations like "Measles and Mumps", "HiBP and paranoia"

Is the order of mention in the data important? I.e., is "measles and mumps" the same as "mumps and measles"?

Art Kendall
Social Research Consultants

On 6/10/2011 4:39 PM, Judy Harmon wrote:

Hello,
 
 
 
 
 
I'm trying to recode some diagnoses, where there are multiple diagnoses.  I
 
 
 
 
 
tried this code, but it's not working.  Can someone help me with this? I'd
 
 
 
 
 
like to add the different diagnoses together to get multiple diagnoses.
 
 
 
 
 
Thanks.
 
 
 
 
 
USE ALL.
 
 
 
 
 
COMPUTE filter_$=(2 = 10 & 3 = 100 & 4 = 1000 & 6 = 100000 & 9 = 100000000
 
 
 
 
 
& 10 = 1000000000 & 12 = 100000000000 & 14 = 10000000000000 & 16 =
 
 
 
 
 
1000000000000000
 
 
 
 
 
  & 18 = 100000000000000000 & 19 = 1000000000000000000).
 
 
 
 
 
VALUE LABELS Axis1Cat1new
 
 
 
 
 
  2 '10'
 
 
 
 
 
  3 '100'
 
 
 
 
 
  4 '1000'
 
 
 
 
 
  6 '10000'
 
 
 
 
 
  9 '100000000'
 
 
 
 
 
  10 '1000000000'
 
 
 
 
 
  12 '100000000000'
 
 
 
 
 
  14 '10000000000000'
 
 
 
 
 
  16 '1000000000000000'
 
 
 
 
 
  18 '100000000000000000'
 
 
 
 
 
  19 '1000000000000000000'.
 
 
 
 
 
EXECUTE.
 
 
 
 
 
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.
 
 
 
 
 
FORMAT filter_$ (f1.0).
 
 
 
 
 
FILTER BY filter_$.
 
 
 
 
 
EXECUTE .
 
 
 
 
 
 
 
 
 
 
 
=====================
 
 
 
 
 
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: Recoding for more than one result

David Marso
Administrator
>compute e1 = d1 .
>do repeat   a = d2 to d22 /b = 1 to 21/e = e2 to e22 .
>compute e = a * 10 **b .
>end repeat .
EPIC FAIL!!!!!!
See my comment from about a week ago re SPSS representation of LARGE integers.
See your resulting table (notice those conspicuous blanks beyond 10**16????)....
I suggested AGGREGATE a few days ago but you apparently ignored that idea....
Mult Response is REALLY not suited for high order XTABS... AGGREGATE IS!!!!
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: Recoding for more than one result

David Marso
Administrator
In reply to this post by John F Hall
>compute e1 = d1 .
>do repeat   a = d2 to d22 /b = 1 to 21/e = e2 to e22 .
>compute e = a * 10 **b .
>end repeat .
EPIC FAIL!!!!!!
See my comment from about a week ago re SPSS representation of LARGE integers.
See your resulting table (notice those conspicuous blanks beyond 10**16????)....
I suggested AGGREGATE a few days ago but you apparently ignored that idea....
Mult Response is REALLY not suited for high order XTABS... AGGREGATE IS!!!!
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: Recoding for more than one result

John F Hall
In reply to this post by Judy Harmon

Judy

 

I’m completely stuck with the attempted binary code for unique combinations.  As David, says SPSS has problems with anything greater than 10**16 and I was trying to create numbers as high as 10**22, so (unless you can condense your diagnoses from 21 to 16) it looks as if you’re stuck with running sets of MULT RESP tables to look for patterns.  With only 192 cases, and given your familiarity with the data, you may glean some combination patterns just by looking at the data in Data View (if you narrow the column displays by dragging the separators you can get all the dummy variables d1 to d22 on screen together.

 

* Create binary dummy variables for each of 22 diagnosis codes .

do repeat

   p = d1 to d22

  /q= 1 to 22 .

count p = num1 to num11 (q) .

recode p (2 thru hi = 1) .

end repeat .

 

One thing I find useful is a serial number for each case: you can then use FREQ or LIST to find cases quickly if they satisfy certain conditions.  You don’t have one in your data, but you can generate one by:

* Difficult working with no case number so: .

compute serial = $casenum.

format serial (f3.0) .

 

* Check a few cases to see if it worked .

list serial /cases 10 .

 

I’ve done this and also checked that the serial numbers tally with the line numbers on the data you sent.

 

David suggested AGGREGATE but I’m not sure how this would work with discovering patterns among the dummy variables d1 to d22.

 

John

 

[hidden email]

www.surveyresearch.weebly.com

 

 

 

123