Rank

Revision as of 22:55, 31 January 2007 by Lchrisman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Returns an array of the rank vaules of X across index I.

Declaration

Rank( X : vector[I] ; I : optional Index ; type : optional atomic numeric = -1 )

where type, if specified, may be one of the following values:

  • -1 = lower-rank (default)
  • 0 = mid-rank
  • 1 = upper-rank

Description

The lowest value in X has a rank value of 1, the next-lowest has a rank of 2, and so on. I is optional if X is one-dimensional. If I is omitted when X has more than one dimension, the innermost dimension is ranked. Since you, as a modeler, have little control over which dimension is the inner dimension, you should always specify I unless you can guarantee that X will always be one-dimensional.

(new to 4.0) The rank type determines how values in X that occur multiple times are ranked. For example, if the value x=5 occurs 6 times, and there are 3 other values in X that are less than 5, then x=5 appears in the sort-order at positions 4,5,6,7,8, and 9. The lower-rank of x=5 is 4, the upper-rank of x=5 is 9, and the mid-rank is 6.5. Note that a mid-rank is not necessary a valid index position (since it may be fractional), so if you intend to use the result of Rank in a slice function, you should use either the lower-rank (the default) or the upper-rank.

The RankCorrel function also allows you to select which rank type to use, but it uses mid-rank by default in Analytica 4.0.

See Also

Comments


You are not allowed to post comments.