LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 1 Sep 2005 13:29:22 -0500
Reply-To:     "Marks, Jim" <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Marks, Jim" <>
Subject:      Re: Position in the ramking to new variables
Content-Type: text/plain; charset="iso-8859-1"



** sample data. DATA LIST FREE /caseid x1 TO x4. BEGIN DATA 1 5 3 72 8 2 1 7 4 16 END DATA.

** find high and low. COMPUTE high_val = MAX(x1 TO x4). COMPUTE low_val = MIN(x1 to x4).

create ranks for high and low. DO REPEAT a = x1 TO x4 / b = y1 TO y4. DO IF a = high_val. COMPUTE b = 4. ELSE IF a = low_val. COMPUTE b = 1.

** create difference value for unranked cases. ELSE. COMPUTE b = a - high_val. END IF. END REPEAT.

** compute new low value (unranked only). COMPUTE low_val = MIN(y1 to y4).

** compute ranks for middle values. DO REPEAT b = y1 TO y4. DO IF b = low_val. RECODE b (LO THRU 0 = 2). ELSE IF b <0. RECODE b (LO THRU 0 = 3). END IF. END REPEAT.

** clean up unneeded variables. ADD FILES FILE = * /DROP high_val low_val. EXECUTE.

This works for your two cases. I don't know what will happen if you have ties in the original scores.


-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Victor Tarrago Sent: Thursday, September 01, 2005 12:02 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Position in the ramking to new variables

Dear list,

We have a "big" problem and we would like to solve it with SPSS. We have 4 different variables (4 channels - x1, x2, x3 and x4) with utility values and we would like to create 4 new variables (one for each channel - y1, y2, y3 and y4) which value has to be the order of each channel in the ranking based on the utilities for each case.

Considering only two cases, we have something like this:

X1 X2 X3 X4 Case 1 5 3 72 8 Case 2 1 7 4 16

And we would like to obtain something like this:

y1 y2 y3 Y4 Case 1 2 1 4 3 Case 2 1 3 2 4

How can we get it? Thank you for your response.

Victor Tarragó Sanromà Acziona Quanlitative Market Consultants Tel. + 34 Fax. + 34 ------------------------------------------------------------------- Important Notice This communication contains information which is confidential and/or privileged and may not necessarily represent the opinion of ACZIONA. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please remind that any distribution, copying or use of this communication or the information in it, is strictly prohibited. If you have received this communication in error please notify us immediately by email and then delete this message and any copies of it. Aviso Importante Este comunicado contiene información confidencial y/o privilegiada y no necesariamente refleja la opinión de ACZIONA. Es para uso exclusivo de su destinatario. Si usted no es su destinatario, tenga en consideración que cualquier acción de distribución, copia o uso total o parcial de esta comunicación o de la información que contiene está estrictamente prohibida. Si usted recibe el mensaje por error, por favor comuníqueselo inmediatamente al remitente a través del e-mail y elimine este mensaje o a cualquier copia de este.

Back to: Top of message | Previous page | Main SPSSX-L page