Learn R Programming

rankdifferencetest

Overview

rankdifferencetest provides a modified Wilcoxon signed-rank test which produces consistent and meaningful results for ordinal or monotonically transformed data. The procedure was described by Diana Kornbrot in https://doi.org/10.1111/j.2044-8317.1990.tb00939.x

Installation

# Install from CRAN
install.packages("rankdifferencetest")

# Or the development version from bitbucket
remotes::install_bitbucket("bklamer/rankdifferencetest")

Examples

# See ?rdt and ?kornbrot_table1
library(rankdifferencetest)

res <- rdt(
  data = kornbrot_table1,
  formula = placebo ~ drug,
  conf_level = 0.95,
  alternative = "two.sided",
  distribution = "asymptotic",
  zero_method = "wilcoxon",
  correct = TRUE
)
res
#> 
#> asymptotic Kornbrot-Wilcoxon rank difference test
#> 
#> p = 0.262
#> Z = 1.12
#> Paired differences of ranks: placebo - drug
#> Alternative hypothesis: True location shift of paired
#> differences of ranks is not equal to 0
#> 
#> Pseudomedian: 1.5
#> 95% CI: -2.5, 6

License

Copyright: Brett Klamer - 2021 - GPL-3 (https://opensource.org/license/gpl-3-0)

Copy Link

Version

Install

install.packages('rankdifferencetest')

Monthly Downloads

190

Version

2025.12.4

License

GPL-3

Maintainer

Brett Klamer

Last Published

December 5th, 2025

Functions in rankdifferencetest (2025.12.4)

srt

Signed-rank test
srt_ranks

Ranks for the signed-rank test.
srt_pvalue

Calculate the p-value for a signed-rank test.
tidy.rdt

Coerce to a data frame
srt_pmedian

Calculate the pseudomedian and confidence interval for a signed-rank test.
srt_statistic

Calculate the test statistic for a signed-rank test.
srt_method

Methods selector for the signed-rank test.
srt_data

Get data for the signed-rank test.
srt_result

Prepare the return object for srt() and rdt().
as.data.frame.rdt

Coerce to a data frame
print.rdt

Print results
reexports

Objects exported from other packages
rdpmedian

Rank difference pseudomedian
rdt

Rank difference test
pmedian

Pseudomedian
rdt_data

Get data for the Kornbrot rank difference test.
rankdifferencetest-package

rankdifferencetest: Kornbrot's Rank Difference Test
kornbrot_table1

Alertness example data