Performs a nonparametric Wilcoxon signed-rank test of whether the median difference between two columns of paired censored data equals 0. Uses the Pratt adjustment for pairs of equal or indistinguishable values.

cen_signedranktest(xd, xc, yd, yc, alternative = "two.sided", printstat = TRUE)

## Arguments

xd

The first column of data values plus detection limits

xc

The column of censoring indicators for xd, where 1 (or TRUE) indicates a detection limit in the xd column, and 0 (or FALSE) indicates a detected value in xd.

yd

The second column of data values plus detection limits, or a single number representing a standard / guideline value.

yc

The column of censoring indicators for yd, where 1 (or TRUE) indicates a detection limit in the yd column, and 0 (or FALSE) indicates a detected value in yd. Not needed if yd is a single standard number.

alternative

The usual notation for the alternate hypothesis. Default is “two.sided”. Options are “greater” or “less”.

printstat

Logical TRUE/FALSE option of whether to print the resulting statistics in the console window, or not. Default is TRUE.

## Value

Prints a list of Wilcoxon Signed-Rank test with Pratt correction for ties statistics containing the following components:

• n Number of samples

• Z The value of the test statistic

• p.value the p-value of the test

## Examples


data(atrazine)

cen_signedranktest(atrazine$June,atrazine$JuneCen,atrazine$Sept,atrazine$SeptCen)
#> Censored signed-rank test for (x:atrazine$June - y:atrazine$Sept) equals 0
#> alternative hypothesis: true difference atrazine$June - atrazine$Sept does not equal 0
#>
#>  Pratt correction for ties
#> n = 24, Z = -3.319, p.value = 0.0009033