|Date: ||Sun, 4 Jun 2000 10:05:41 -0400|
|Reply-To: ||Raynald Levesque <rlevesque@VIDEOTRON.CA>|
|Sender: ||"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>|
|From: ||Raynald Levesque <rlevesque@VIDEOTRON.CA>|
|Subject: ||Re: Recoding with scripts|
|Content-type: ||text/plain; charset=iso-8859-1|
Hi Mark and Sorin,
Regarding Sorin's question 2 below:
* To rank a var1 based on equal distances between min and max value of var1.
DATA LIST FREE /var1(F8).
0 15 31 91
17 24 29 98
57 90 6 7
100 24 74 21
/var1_min = MIN(var1) /var1_max = MAX(var1).
MATCH FILES /FILE=*
*Lets say you want to separate values in 8 intervals.
COMPUTE #delta=(var1_max - var1_min)/8.
A short technical note:
The intervals are closed on the left and opened on the right. Thus,
inter=1 when var1 is in the interval [var1_min, var1_min + 1*#delta)
inter=2 when var1 is in the interval [var1_min+1*delta, var1_min + 2*#delta)
inter=8 when var1 is in the interval [var1_min+7*delta, var1_min + 8*#delta)
inter=9 when var1= var1_max.
The purpose of the last COMPUTE is to force cases with var1=var1_max into
the interval 8. In
other words inter =8 is for cases in the closed interval [var1_min+7*delta,
var1_min + 8*#delta].
One impecfect method to avoid this adjustment would be to define delta as
COMPUTE #delta=1.000001*(var1_max - var1_min)/8.
Raynald Levesque email@example.com
----- Original Message -----
From: Mark Casazza
Sent: Tuesday, May 23, 2000 9:33 AM
Subject: Re: Recoding with scripts
The first is easy enough if you use the /NTILES subcommand with the RANK
command. It would look like this:
RANK VAR=SCORE /NTILES(4) INTO R_SCORE.
This would produce 4 values for R_SCORE (1,2,3,4) based on quartiles of
score. You can use any number of partitions by changing the "4" after
NTILES. As for the second question, I don't have a quick answer maybe
someone else does.
At 04:48 AM 2000-05-23 , Sorin Sion wrote:
Is there any way to create a new variable at ordinal level, based on a
To be more specific, if you have a continuous variation variable, is it
possible to create a new variable with values that are:
1. quantiles of the variable
2. codes that represents equal intervals between the min and the max of the
I suppose this can be done with scripts.
In the first case, it would require the number of quantiles and in the
second case the number of intervals needed.
Thanks in advance for any tip.
Market Research Analyst
MobiFon S.A. - ROMANIA
Mark V. Casazza
Senior Research Analyst
Office of Research, Assessment and Planning
Adelphi University, Levermore Hall #307
Garden City, NY 11530