|
PERCENTAGE RANKName:
with Ri and N denoting the rank of the i-th element and the number of observations, respectively. Ranks are frequently used in nonparametric statistical analysis. Some analysts like to the think of the ranks in terms of percentages.
<SUBSET/EXCEPT/FOR qualification> where <y1> is a response variable; <y2> is a variable where the percentage ranks are saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
let y1 = norm rand numb for i = 1 1 20
let y2 = rank y1
let y3 = percentage rank y1
.
set write decimals 3
print y1 y2 y3
The following output is generated.
---------------------------------------------
Y1 Y2 Y3
---------------------------------------------
-1.073 1.000 2.500
0.573 17.000 82.500
-0.873 2.000 7.500
0.233 13.000 62.500
-0.455 6.000 27.500
-0.525 5.000 22.500
-0.705 4.000 17.500
0.032 11.000 52.500
1.190 19.000 92.500
0.269 15.000 72.500
-0.149 9.000 42.500
-0.196 8.000 37.500
-0.243 7.000 32.500
-0.840 3.000 12.500
-0.103 10.000 47.500
0.418 16.000 77.500
0.263 14.000 67.500
0.898 18.000 87.500
0.034 12.000 57.500
1.587 20.000 97.500
Date created: 01/26/2012 |