Analysis of MRSets

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

Analysis of MRSets

Georg Maubach-2
Analysis of MRSets

Hi All

when using MRSet with SPSS Statistics 17 we found out that SPSS does include only those cases which have at least one value to count in the MRSet variables. In our analysis we want to have all cases - either with an answer (coded as 1) or with no ansswer (coded as 0) - in the results.

Is there a switch that I can use to tell SPSS that I would like to base the percents on all cases?

Best regards

Georg


Reply | Threaded
Open this post in threaded view
|

Recoding Variables

E. Bernardo
Hi Folks,
 
I have three variables X,Y and Z where the values of each range from 0 to 12.  I want to create a fourth variable W such that:
 
W =3 if X is the maximum of X, Y and Z
W = 2 if X is the second largest among X,Y and Z
W= 1 if  X is the smallest among X,Y and Z
W = 0 if X=Y=Z
 
For example:
 
X      Y        Z     W
8      3       1        3
4      7       1        2
2      5       3        1
4      4       4        0
 
Any syntax for this?
 
Eins
 


Have a new Yahoo! Mail account?
Kick start your journey by importing all your contacts!
Reply | Threaded
Open this post in threaded view
|

Re: Recoding Variables

George Emerson D'Umbra
Hi Eins,
 
This will do it (but you'll have to care about missing values - what happens if there is missing values for X, Y or Z?):
 
compute #max = max(x,y,z).
compute #min = min(x,y,z).
do if x = #max and x = #min.
  compute w = 0.
else if x = #max.
  compute w = 3.
else if x =#min.
  compute w = 1.
else.
  compute w = 2.
end if.
EXECUTE .
----- Original Message -----
Sent: Thursday, November 19, 2009 11:47 AM
Subject: Recoding Variables

Hi Folks,
 
I have three variables X,Y and Z where the values of each range from 0 to 12.  I want to create a fourth variable W such that:
 
W =3 if X is the maximum of X, Y and Z
W = 2 if X is the second largest among X,Y and Z
W= 1 if  X is the smallest among X,Y and Z
W = 0 if X=Y=Z
 
For example:
 
X      Y        Z     W
8      3       1        3
4      7       1        2
2      5       3        1
4      4       4        0
 
Any syntax for this?
 
Eins
 


Have a new Yahoo! Mail account?
Kick start your journey by importing all your contacts!
Reply | Threaded
Open this post in threaded view
|

Re: Analysis of MRSets

Heidi Green
In reply to this post by Georg Maubach-2
Analysis of MRSets

I always create one more field to add to my MR Set. This one is labeled “None Selected” and used just like the other fields.

For example, if I have a set of dichotomous fields called q03_01 q03_02 q03_03 q03_04 q03_05, I create q03none to add to it.

 

NUMERIC q03none (F1.0) .

 

RECODE q03_01 TO q03_05 q03none (MISSING=0).

 

IF(NOT ANY(1, q03_01 TO q03_05))q03none=1.

 

Note: recoding the missing values to zero works well for the analysis I’m doing, it may not work for your purpose.

 

Then my MR set looks like this:

 

** Dichotomies (0/1).

MRSETS

  /MDGROUP NAME=$MRq03 LABEL ='What aspects do you like best? (Mark all that apply)'

   VARIABLES= q03_01 TO q03_05 q03none

   VALUE=1

  /DISPLAY NAME=[$MRq03].

 

This forces everyone into the table I run:

 

CTABLES

  /FORMAT EMPTY=ZERO MISSING='NA'  /SMISSING VARIABLE

  /VLABELS VARIABLES=$MRq03 DISPLAY=DEFAULT

  /TABLE $MRq03 [COUNT COMMA40.0, COLPCT.RESPONSES.COUNT PCT40.1, RESPONSES COMMA40.0, COLPCT.RESPONSES PCT40.1]

  /CATEGORIES VARIABLES=$MRq03 ORDER=D KEY=COUNT EMPTY=INCLUDE TOTAL=YES POSITION=AFTER

  /TITLES

   TITLE= ')TABLE'

   CAPTION=

    '* The Count and Column Response % (Base: Count) columns may sum to more than their ' +

    'totals due to multiple responses.' .

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Georg Maubach
Sent: Thursday, November 19, 2009 4:54 AM
To: [hidden email]
Subject: Analysis of MRSets

 

Hi All

when using MRSet with SPSS Statistics 17 we found out that SPSS does include only those cases which have at least one value to count in the MRSet variables. In our analysis we want to have all cases - either with an answer (coded as 1) or with no ansswer (coded as 0) - in the results.

Is there a switch that I can use to tell SPSS that I would like to base the percents on all cases?

Best regards

Georg

 



____________
DefenderMX2.
Reply | Threaded
Open this post in threaded view
|

AW: Analysis of MRSets

Georg Maubach-2
Analysis of MRSets
Hi Heidi,
 
many thanks for your reply. I will do as you suggested to have a work around.
 
Many thanks again.
 
Best regards
 
Georg
 


Von: Heidi Green [mailto:[hidden email]]
Gesendet: Donnerstag, 19. November 2009 17:37
An: Maubach, Georg MRSC; [hidden email]
Betreff: RE: Analysis of MRSets

I always create one more field to add to my MR Set. This one is labeled “None Selected” and used just like the other fields.

For example, if I have a set of dichotomous fields called q03_01 q03_02 q03_03 q03_04 q03_05, I create q03none to add to it.

 

NUMERIC q03none (F1.0) .

 

RECODE q03_01 TO q03_05 q03none (MISSING=0).

 

IF(NOT ANY(1, q03_01 TO q03_05))q03none=1.

 

Note: recoding the missing values to zero works well for the analysis I’m doing, it may not work for your purpose.

 

Then my MR set looks like this:

 

** Dichotomies (0/1).

MRSETS

  /MDGROUP NAME=$MRq03 LABEL ='What aspects do you like best? (Mark all that apply)'

   VARIABLES= q03_01 TO q03_05 q03none

   VALUE=1

  /DISPLAY NAME=[$MRq03].

 

This forces everyone into the table I run:

 

CTABLES

  /FORMAT EMPTY=ZERO MISSING='NA'  /SMISSING VARIABLE

  /VLABELS VARIABLES=$MRq03 DISPLAY=DEFAULT

  /TABLE $MRq03 [COUNT COMMA40.0, COLPCT.RESPONSES.COUNT PCT40.1, RESPONSES COMMA40.0, COLPCT.RESPONSES PCT40.1]

  /CATEGORIES VARIABLES=$MRq03 ORDER=D KEY=COUNT EMPTY=INCLUDE TOTAL=YES POSITION=AFTER

  /TITLES

   TITLE= ')TABLE'

   CAPTION=

    '* The Count and Column Response % (Base: Count) columns may sum to more than their ' +

    'totals due to multiple responses.' .

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Georg Maubach
Sent: Thursday, November 19, 2009 4:54 AM
To: [hidden email]
Subject: Analysis of MRSets

 

Hi All

when using MRSet with SPSS Statistics 17 we found out that SPSS does include only those cases which have at least one value to count in the MRSet variables. In our analysis we want to have all cases - either with an answer (coded as 1) or with no ansswer (coded as 0) - in the results.

Is there a switch that I can use to tell SPSS that I would like to base the percents on all cases?

Best regards

Georg

 



____________
DefenderMX2.
Reply | Threaded
Open this post in threaded view
|

Re: Analysis of MRSets

alexwin
In reply to this post by Georg Maubach-2
Hi Georg,

the easiest way to get all cases as the percetage base is to use such summary statistics as Column Total N %, Row Total N % etc. For example:

data list free / sex v1 to v3.
begin data.
1 1 1 1
1 0 0 1
1 0 1 1
1 0 0 0
1 0 0 0
2 1 1 0
2 1 0 0
2 1 1 1
2 0 0 0
2 0 0 0
end data.

variable level sex (nominal).

* Define Multiple Response Sets.
MRSETS
  /MDGROUP NAME=$V CATEGORYLABELS=VARLABELS VARIABLES=v1 v2 v3 VALUE=1
  /DISPLAY NAME=[$V].

* Custom Tables.
CTABLES
  /VLABELS VARIABLES=sex $V DISPLAY=DEFAULT
  /TABLE $V [COUNT F40.0, COLPCT.COUNT PCT40.1, COLPCT.TOTALN PCT40.1] BY sex
  /CATEGORIES VARIABLES=sex ORDER=A KEY=VALUE EMPTY=EXCLUDE
  /CATEGORIES VARIABLES=$V  EMPTY=INCLUDE TOTAL=YES POSITION=AFTER.

HTH,

Dr. Alexander Vinogradov, Associate Professor
Sociology and Psychology Faculty
National Taras Shevchenko University
Ukraine

> Hi All
> when using MRSet with SPSS Statistics 17 we found out that SPSS does
include only those cases which have at least one value to count in the
MRSet variables. In our analysis we want to have all cases - either with an answer (coded as 1) or with no ansswer (coded as 0) - in the results.

> Is there a switch that I can use to tell SPSS that I would like to base the percents on all cases?

> Best regards

> Georg



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