Performs a nonparametric Paired Prentice-Wilcoxon test of whether the median difference between two columns of paired censored data equals 0 (O'Brien and Fleming, 1987)

ppw.test(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, 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

yc

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

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

Paired Prentice-Wilcoxon test results including Z-statistic, n (sample size), p-value and median difference

References

Helsel, D.R., 2011. Statistics for Censored Environmental Data using Minitab and R, 2nd ed. John Wiley & Sons, USA, N.J.

O’Brien, P.C., Fleming, T.R., 1987. A Paired Prentice-Wilcoxon Test for Censored Paired Data. Biometrics 43, 169–180. https://doi.org/10.2307/2531957

Examples

data(PbHeron)
ppw.test(PbHeron$Liver,PbHeron$LiverCen,PbHeron$Bone,PbHeron$BoneCen)
#> Paired Prentice Wilcoxon test for (x:PbHeron$Liver - y:PbHeron$Bone) equals 0
#>     alternative: PbHeron$Liver not equal to PbHeron$Bone
#>  
#>  n = 27   Z = -3.541   p-value = 0.000398 
#>   Median difference equals -0.8902562