| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
[R,TIEADJ] = tiedrank(X)
[R,TIEADJ] = tiedrank(X,1)
[R,TIEADJ] = tiedrank(X,0,1)
[R,TIEADJ] = tiedrank(X) computes the ranks of the values in the vector X. If any X values are tied, tiedrank computes their average rank. The return value TIEADJ is an adjustment for ties required by the nonparametric tests signrank and ranksum, and for the computation of Spearman's rank correlation.
[R,TIEADJ] = tiedrank(X,1) computes the ranks of the values in the vector X. TIEADJ is a vector of three adjustments for ties required in the computation of Kendall's tau. tiedrank(X,0) is the same as tiedrank(X).
[R,TIEADJ] = tiedrank(X,0,1) computes the ranks from each end, so that the smallest and largest values get rank 1, the next smallest and largest get rank 2, etc. These ranks are used in the Ansari-Bradley test.
Counting from smallest to largest, the two 20 values are 2nd and 3rd, so they both get rank 2.5 (average of 2 and 3):
tiedrank([10 20 30 40 20])
ans =
1.0000 2.5000 4.0000 5.0000 2.5000 ansaribradley, corr, partialcorr, ranksum, signrank
![]() | TestSize property (cvpartition) | times (categorical) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |