plot.lwy.test {surv2sample}R Documentation

Plot an Observed Test Process and Simulated Paths

Description

This function plots an observed test process along with simulated paths. Such a plot may be used to visually assess the hypothesis.

Usage

## S3 method for class 'lwy.test':
plot(x, lwds = c(3, 1), cols = c("black", "grey"),
     ltys = c(1, 1), ...)

Arguments

x an object of class "lwy.test".
lwds a vector of length 2, giving the line width for the observed process and for simulated processes.
cols a vector of length 2, giving the line colour for the observed process and for simulated processes.
ltys a vector of length 2, giving the line type for the observed process and for simulated processes.
... other standard parameters for plotting.

Details

In survival analysis, p-values of Kolmogorov–Smirnov and other tests based on a test process may be approximated by the martingale-based simulation technique originally proposed by Lin, Wei and Ying (1993). By plotting the observed test process along with a suitable number of simulated paths, one may visually assess the validity of the hypothesis.

This function is a general plot method for such tests. Results of such tests are objects with class attribute "lwy.test", at least containing sorted times in x$time, the observed process in x$test.process and a number (x$nsim.plot) of simulated processes in x$test.process.sim. Results of functions listed in ‘See Also’ below are handled by this plot method.

Author(s)

David Kraus (http://www.davidkraus.net/)

References

Lin, D. Y., Wei, L. J. and Ying, Z. (1993) Checking the Cox model with cumulative sums of martingale-based residuals. Biometrika 80, 557–572.

See Also

surv2.ks, cif2.ks, proprate2.ks

Examples

## gastric cancer data
data(gastric)

## Kolmogorov--Smirnov test of equal survival distributions
## test process = difference of Nelson--Aalen estimates
## plot the observed test process and simulated paths
plot(surv2.ks(Surv(gastric$time, gastric$event),
    gastric$treatment, approx="mart"))

[Package surv2sample version 0.1-2 Index]