View source: R/censKSample.test.R
censKSample.test | R Documentation |
Performs a test for differences in left-censored samples from 2 or more groups.
censKSample.test(x, groups, type = "Peto", data.names)
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. |
An object of class "htest."
The null hypothesis is that the distributions in each group are not different from one another.
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.
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.
survdiff
, lcens-class
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.