Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

BRANKS Function

computes bivariate ranks

BRANKS( matrix)

where matrix is an n ×2 numeric matrix.

The BRANKS function calculates the tied ranks and the bivariate ranks for an n ×2 matrix and returns an n ×3 matrix of these ranks. The tied ranks of the first column of matrix are contained in the first column of the result matrix; the tied ranks of the second column of matrix are contained in the second column of the result matrix; and the bivariate ranks of matrix are contained in the third column of the result matrix.

The tied rank of an element xj of a vector is defined as
R_i = \frac{1}2 + \sum_j u(x_i - x_j)
where
u(t) = \{ 1 & & {if } t\gt \ \frac{1}2 & & {if } t=0 \ 0 & & {if } t\lt  .
 .
The bivariate rank of a pair (xj,yj) is defined as
Q_i = \frac{3}4 + \sum_j u(x_i - x_j) u(y_i - y_j)  .
For example, the following statements produce the result shown below:
   x={1 0,
      4 2,
      3 4,
      5 3,
      6 3};
   f=branks(x);

              F             5 rows      3 cols    (numeric)

                              1         1         1
                              3         2         2
                              2         5         2
                              4       3.5         3
                              5       3.5       3.5

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.