# Pseudo-Ranks

Efficient calculation of pseudo-ranks and (pseudo)-rank based test statistics. In case of equal sample sizes, pseudo-ranks and mid-ranks are equal. When used for inference mid-ranks may lead to paradoxical results. Pseudo-ranks are in general not affected by such a problem .

This R package provides a function written in C++ to calculate pseudo-ranks in R and some rank statistics which can opionally use pseudo-ranks instead of ranks. For a definition and discussion of pseudo-ranks, see for example

Brunner, E., Bathke A. C. and Konietschke, F: Rank- and Pseudo-Rank Procedures in Factorial Designs - Using R and SAS, Springer Verlag, to appear.

To install the current development version from github:

## Calculating Pseudo-Ranks

The function 'pseudorank' can either be used with data.frames or with vectors. Please note that when using a data.frame only one grouping factor can be used.

Similarly to the 'rank' function from base R, there are several different methods which can be used to handle ties in the data. Most nonparametric tests rely on so-called mid-(pseudo)-ranks, these are just the average of minimum and maximum (pseudo)-ranks.

In case of missing values there are three options to choose from. These are the same as for the function 'rank' or 'sort' from base R. It is recommended to use 'na.last = NA' to remove the NAs. If the NAs are kept, they can either be put at the beginning or the end of your data, then the pseudo-ranks from those NAs depend on the order they appear in the data. The order does not matter only if the groups containing missing values have the same sample size. See the following R Code for an example of this problem where observation 1 and 4 are interchanged. Here, the pseudo-ranks for those two observations are different, all other pseudo-ranks remain unchanged.

## Hettmansperger-Norton Test for Patterned Alternatives in k-Sample Problems

The test implemented in this package uses pseudo-ranks instead of ranks. This is mainly due to paradoxical results caused by ranks. See

Brunner, E., Konietschke, F., Bathke, A. C., & Pauly, M. (2018). Ranks and Pseudo-Ranks-Paradoxical Results of Rank Tests. arXiv preprint arXiv:1802.05650.

for a discussion of this problem.

## Kruskal-Wallis Test with Pseudo-Ranks

The Kruskal-Wallis test implemented in this package can use pseudo-ranks, if the argument 'pseudoranks = TRUE' is used.

# pseudorank 0.3.7

• Changed function name ''psrank'' to ''pseudorank'' and set ''psrank'' as deprecated.
• Added a data set which can be used to show paradoxical results from rank tests.

# pseudorank 0.3.0

• Added the Kruskal-Wallis test with an option to use either ranks or pseudo-ranks.
• Added an option to use the Hettmansperger-Norton test with ranks.
• Fixed a bug in the computation of maximum pseudo-ranks.

# Reference manual

install.packages("pseudorank")

1.0.1 by Martin Happ, a year ago

https://github.com/happma/pseudorank/

Report a bug at https://github.com/happma/pseudorank/issues/

Browse source code at https://github.com/cran/pseudorank

Authors: Martin Happ [aut, cre] , Georg Zimmermann [aut] , Arne C. Bathke [aut] , Edgar Brunner [aut]

Documentation:   PDF Manual

Imports Rcpp, doBy

Suggests testthat