ppw.test: Test for difference in left-censored samples

View source: R/ppw.R

ppw.testR Documentation

Test for difference in left-censored samples

Description

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)

Usage

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

See Also

survival::survfit survival::Surv

Examples

data(PbHeron)
ppw.test(PbHeron$Liver,PbHeron$LiverCen,PbHeron$Bone,PbHeron$BoneCen)


NADA2 documentation built on Oct. 20, 2023, 5:07 p.m.