(a) 
Ranks
For a given variable, $j$ say, each of the observations ${x}_{ij}$ for which ${w}_{i}=1$, for $\mathit{i}=1,2,\dots ,n$, has associated with it an additional number, the ‘rank’ of the observation, which indicates the magnitude of that observation relative to the magnitudes of the other observations on that same variable for which ${w}_{i}=1$.
The smallest of these valid observations for variable $j$ is assigned the rank $1$, the second smallest observation for variable $j$ the rank $2$, the third smallest the rank $3$, and so on until the largest such observation is given the rank ${n}_{c}$, where ${n}_{c}={\displaystyle \sum _{i=1}^{n}}{w}_{i}$.
If a number of cases all have the same value for the given variable, $j$, then they are each given an ‘average’ rank, e.g., if in attempting to assign the rank $h+1$, $k$ observations for which ${w}_{i}=1$ were found to have the same value, then instead of giving them the ranks
all $k$ observations would be assigned the rank
and the next value in ascending order would be assigned the rank
The process is repeated for each of the $m$ variables.
Let ${y}_{ij}$ be the rank assigned to the observation ${x}_{ij}$ when the $j$th variable is being ranked. For those observations, $i$, for which ${w}_{i}=0$, ${y}_{ij}=0$, for $j=1,2,\dots ,m$.
The actual observations ${x}_{ij}$ are replaced by the ranks ${y}_{ij}$, for $\mathit{i}=1,2,\dots ,n$ and $\mathit{j}=1,2,\dots ,m$. 
(b) 
Nonparametric rank correlation coefficients
(i) 
Kendall's tau:
where 
${n}_{c}={\displaystyle \sum _{i=1}^{n}}{w}_{i}$ 
and 
$\mathrm{sign}u=1$ if $u>0$ 

$\mathrm{sign}u=0$ if $u=0$ 

$\mathrm{sign}u=1$ if $u<0$ 
and ${T}_{j}=\sum {t}_{j}\left({t}_{j}1\right)$ where ${t}_{j}$ is the number of ties of a particular value of variable $j$, and the summation is over all tied values of variable $j$. 
(ii) 
Spearman's:
where ${n}_{c}={\displaystyle \sum _{i=1}^{n}}{w}_{i}$ and ${T}_{j}^{*}=\sum {t}_{j}\left({t}_{j}^{2}1\right)$ where ${t}_{j}$ is the number of ties of a particular value of variable $j$, and the summation is over all tied values of variable $j$. 
