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

View source: R/censKSample.test.R

censKSample.testR Documentation

Test for difference in left-censored samples

Description

Performs a test for differences in left-censored samples from 2 or more groups.

Usage

censKSample.test(x, groups, type = "Peto", data.names)

Arguments

x

the samples from each group. Forced to class "lcens." Missing values are removed before the analysis.

groups

the group identifier for each sample. Missing values are removed before the analysis.

type

the string "Peto" or "log-rank," depending on the desired type of test. Default is "Peto."

data.names

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

Value

An object of class "htest."

Null Hypothesis

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

Note

The censKSample.test function use the survdiff function to test for differences. 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.

Tableman and others (2004) state, "the Peto test emphasizes the beginning of the survival curve in that earlier failures receive larger weights. The log-rank test emphasizes the tail of the survival curve in that it gives equal weight to each failure." For flipped data, earlier failures translates to larger uncensored values. In general, the Peto test gives results that are more similar to the Wilcoxon test if all data are uncensored.

References

Helsel, D.R. 2012, Statistics for censored environmental data using Minitab and R: New York, Wiley, 324 p.

Peto, R., and Peto, J., 1972, Asymptotically efficient rank invariant test procedures (with discussion): Journal of the Royal Statistical Society, Series A v. 135, p. 185-206.

Prentice, R.L. 1978, Linear rank tests with right-censored data: Biometika, v 65, p 167-179.

Prentice, R.L., and Marke, P., 1979, A qualitative discrepancy between censored data rank tests: Biometrika, v. 35, p. 861-867.

Tableman, M., and Kim, J.S., 2004, Survival analysis using S—analysis of time-to-event data: Boca Raton, Fla., Chapman and Hall, 280 p.

See Also

survdiff, lcens-class

Examples


# Compare uncensored results
set.seed(69)
Xu <- rlnorm(22, 0, 1)
Yu <- rlnorm(22, .4, 1)
Zu <- rlnorm(22, 1, 1)
Gu <- factor(rep(c("X", "Y", "Z"), each=22))
censKSample.test(c(Xu, Yu, Zu), Gu)
kruskal.test(c(Xu, Yu, Zu), Gu)
# Censor the data at 1
censKSample.test(as.lcens(c(Xu, Yu, Zu), 1), Gu)


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