Percentiles

조회 수: 11 (최근 30일)
Colin
Colin 2012년 6월 11일
편집: David Ebert 2022년 4월 3일
Is there a function that returns the percentile, p, for a given value, x, in array, A?
As opposed to prtcile(A,p) which returns x for array A and percentile p.
The equivalent Excel function is PERCENTRANK.
Thanks

답변 (1개)

Colin
Colin 2012년 6월 11일
I found this via google search...
A function to calculate the percent rank of each element of a matrix is not available in MATLAB (as at end June 2009).
To work around this issue, use the function TIEDRANK from the Statistics Toolbox and normalize by dividing by the length of the input vector. This converts the result to percentiles.
eg. x = rand(1,40); tiedrank(x)/length(x);
  댓글 수: 1
David Ebert
David Ebert 2022년 4월 3일
편집: David Ebert 2022년 4월 3일
Thanks, appreciate it, was looking for a similar function.

댓글을 달려면 로그인하십시오.

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by