Date: Fri, 12 Jun 2009 13:30:25 -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
In-Reply-To: <FD864CB3CC3CFD4DB6F8B5B1C87C9E14064B5A9F@sato.evms.net>
Content-Type: multipart/alternative;
Disregard! I figured it out. Thanks!!!!!
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
________________________________
From: Handel, Richard W.
Sent: Friday, June 12, 2009 12:35 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: ranking syntax
Hi All,
I am looking for a little syntax help.
Here is what I would like to do:
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.)
Any ideas?
Thanks,
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
[text/html]