Language Reference

BRANKS Function

computes bivariate ranks

BRANKS( matrix)

where matrix is an n x 2 numeric matrix.

The BRANKS function calculates the tied ranks and the bivariate ranks for an n x 2 matrix and returns an n x 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 x_j 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 (x_j,y_j) is defined as
q_i = \frac{3}4 + \sum_j u(x_i - x_j) u(y_i - y_j)
For example, consider the following statements and the output they produce:
  
    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
 

Previous Page | Next Page | Top of Page