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

View source: R/ppw.test.R

ppw.testR Documentation

Test for difference in left-censored samples

Description

Tests for differences in paired left-censored samples from two groups using the PPW test (O'Brien and Fleming, 1987).

Usage

ppw.test(x, y, alternative = "two.sided", OBrienFleming = TRUE, data.names)

Arguments

x

the paired samples to y. Forced to class "lcens." Missing values are removed before the analysis.

y

the paired values to x. Missing values are removed before the analysis.

alternative

character string describing the alternative hypothesis. Must be one of "two.sided," "greater," or "less."

OBrienFleming

logical, if TRUE, then apply the OBrienFleming otherwise it is not applied. See Details.

data.names

character string to be used to explain the data. Default names are derived from the data arguments.

Details

The O'Brien-Fleming adjustment forces the score for all paired censored values to be equal to each other. It also forces equality between observed values that are less than the detection limit in the paried sample by setting the value to less than the detection limit.

Value

An object of class "htest" that inherits "ppw."

Null Hypothesis

The null hypothesis is that the distributions are not different from one another.

Note

The ppw.test function uses the survfit function. Helsel (2012) describes flipping the left-censored data so that small values become large and left-censored values become right-censored values and adapt nonparametric techniques from survival analysis.
A plot method is supported for the returned object.

References

Helsel, D.R. 2012, Statistics for Censored Environmental Data Using Minitab and R: New York, Wiley, 324 p.

O'Brien, P.C. and Fleming, T.R., 1987, A paired Prentice-Wilcoxon test for censored paried data: Biometrics, v. 43, p. 451–455.

See Also

survdiff, survfit, lcens-class

Examples


# Compare uncensored results
set.seed(699)
Xu <- sort(rlnorm(22, 0, 1))
Yu <- sort(rlnorm(22, .425, 1))
# Treat as paired samples
ppw.test(Xu, Yu)
wilcox.test(Xu, Yu, paired=TRUE)


USGS-R/smwrQW documentation built on Oct. 11, 2022, 6:13 a.m.