Biology, images, analysis, design...
Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

Search this site



Just a note

Notice that a p-value calculated as the corrected relative rank of a sample is slightly different from the p-value as defined in the theoretical parts of statistics textbooks.
    Under that strict conventional definition of p, it should be calculated from the relative rank, not the corrected relative rank. In other words, if you define p is the proportion of y whose rank is equal to or less than the rank of y, then p=r/n.

    But, when n is finite, and p=r/n, then p can be anywhere from 1/n to 1. So 1 - p can be anywhere from 0 to 1-1/n, which would automatically make the resulting graph asymmetrical.

    Therefore for the inverse cumulative distribution, you should plot q on y, where q=(n-r+1)/n, where q is the proportion of y whose rank equals or exceeds the rank of each observed y.

In practice it is much simpler, and often much better, to define p as r/n - 0.5/n.

The following code produces much the same sort of result using R.