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 (June 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 12 Jun 2009 13:37:32 -0400
Reply-To:     "Handel, Richard W." <HandelRW@EVMS.EDU>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Handel, Richard W." <HandelRW@EVMS.EDU>
Subject:      Re: ranking syntax
Comments: To: Gene Maguin <emaguin@buffalo.edu>
In-Reply-To:  A<C8F106C585464D9BA08582E7DA160032@ssw.buffalo.edu>
Content-Type: text/plain; charset="us-ascii"

Gene,

Thanks. I found syntax on raynald's site that ranks within cases. It was easy to modify it to do what I want. Thanks again.

Rick

Richard W. Handel, Ph.D. Associate Professor Department of Psychiatry and Behavioral Sciences Eastern Virginia Medical School 825 Fairfax Avenue, Hofheimer Hall Norfolk, VA 23507 Phone (757)-446-7992

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Gene Maguin Sent: Friday, June 12, 2009 1:31 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: ranking syntax

Richard,

A realy simple way to do this, provided you don't have too many cases, and even then, I'd guess, it could be done in stages, is use the Flip command to flip the dataset so that variables are now rows and subjects are now columns (and, thus, variables). Next, use the Rank command to rank the variables. Finally, use the Flip command again to restore the dataset to its original structure. I haven't done this in a long time but I'll bet others have and can comment. Try this out and see if it will work for you. Post back and let us know.

The alternative is to write syntax to do a within cases sort and while that is not too hard, accounting for ties and for missing data makes the code complex.

Gene Maguin

>>1) Take 10 variables (x1 to x10) that have integer values between 30 and 100. 2) Create syntax that rank orders these variables and writes them out to a second set of variables based on rank order (in ascending order). In other words, the second set of variables would indicate the relative standing of each case (X1 to X10). (Let's say the second set of variables is named X1a to X10a.)

So, it would end up like this (I will limit it to 3 variables for this example):

Input data: X1 = 50 X2 = 70 X3 = 55

New Variable: X1a = 1 X2a = 3 X3a = 2.

The more complicated issue is that a tie needs to be assigned a mid-point value. So, if

Input data: X1 = 50 X2 = 50 X3 = 70

Then, X1a = 1.5 X2a = 1.5 X3a = 3

(That is, X3 is still the third highest score.)

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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 LISTSERV@LISTSERV.UGA.EDU (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


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