Matrix RankTieC( Matrix m )
The return value is a matrix whose elements are the ranks of the corresponding elements of m. The ranks of tied values are averaged.
Matrix m
A character matrix or literal.
This function behaves like the built-in SAS/IML RANKTIE function except that RankTieC computes the ranks of a character matrix instead of a numeric matrix. Note that uppercase
letters precede lowercase letters in the ASCII order, so if you want to compare mixed-case strings, you may want to call ranktiec( upcase( m ) )
.
m = { "it" "was" "the", "best" "of" "times", "it" "was" "the", "worst" "of" "times" }; r = ranktiec( m ); print r;