Dataplot Vol 2 Vol 1

# RANK INDEX

Name:
RANK INDEX (LET)
Type:
Let Subcommand
Purpose:
Compute the ranks of a variable where each rank will be a unique integer value.
Description:
When the RANK command encouters ties in the response variable, all tied values are given the same average rank. For example, if ranks 5 and 6 denote the same value, then each would be assinged a rank of 5.5.

The RANK INDEX command performs ranking. However, it handles ties differently. For example, if ranks 5 and 6 denote the same value, this command will return 5 and 6 as the ranks rather than 5.5 for both.

This command is useful when you want to use the rank as an index to another variable. An example is given in the program example below.

Syntax:
LET <y> = RANK INDEX <x>             <SUBSET/EXCEPT/FOR qualification>
where <x> is the variable for which the ranks are to be computed;
<y> is a variable where the computed ranks are saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET Y = RANK INDEX X
Default:
None
Synonyms:
None
Related Commands:
 RANK = Rank the elements in a variable. RANK2 = Rank the elements in a variable where there is grouping in the data. SORT = Sort the elements in a variable. SORTC = Sort the elements in a variable and carry one or more variables along.
Applications:
Nonparametric statistics
Implementation Date:
2010/6
Program:
```
skip 25
let string s1 = Tinius1
let string s2 = Tinius2
let string s3 = Satec
let string s4 = Tokyo
.
let xsort iindx = sort by median y x
set let cross tabulate collapse
let y2 = cross tabulate median y x
let x2 = rank index y2
loop for k = 1 1 4
let ival = x2(k)
let string t^ival = ^s^k
end of loop
x1tic mark label case asis
x1tic mark label format alpha
x1tic mark label content ^t1 ^t2 ^t3 ^t4
.
char box plot
line box plot
fences on
.
xlimits 1 4
major xtic mark number 4
minor xtic mark number 0
xtic offset 0.5 0.5
.
title case asis
title offset 2
title Charpy V-NIST Notch Testing
label case asis
x1label Machine Manufacturer
y1label Absorbed Energy
.
box plot y xsort
```

Date created: 9/8/2010
Last updated: 9/8/2010