plotbands: Plot an Exact Nonparametric Confidence Band for the...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plotbands.R

Description

Computes, and then plots, an exact nonparametric confidence band for the population survivor function based on its one-sample Kaplan-Meier estimate and the modified B-J statistic. The confidence level, which can be specified by the user, must be a proportion between 0 and 1.

Usage

1
  plotbands(sobj,conf.level=0.95,...)

Arguments

sobj

a one-sample Kaplan-Meier estimate, provided in the form of a survfit.object.

conf.level

confidence level, a proportion between 0 and 1. The default value is 0.95

...

Additional arguments, such as axis labels, scaling, etc., to pass to the generic plot function used for a survfit.object

Details

An exact nonparametric confidence band with the specified level of confidence is plotted as lower and upper estimates of the survivor function. These estimates are calculated by the function confband. Option lty=2 in the display distinguishes the nonparametric confidence band from the Kaplan-Meier estimate which, by default, is plotted as a solid line (lty=1)

Value

The function returns two outputs, a scalar, which is printed, and a plot. The scalar value is the required quantile from the exact null distribution of the sample-specific modified B-J statistic derived from the single-sample nonparametric Kaplan-Meier estimate.

Author(s)

David E. Matthews dematthews@uwaterloo.ca

See Also

confband

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## plot an exact, nonparametric, 95% confidence band for leukemia patient 
## remission experience based on data from 20 patients receiving 
## Treatment B
time<-c(1,1,2,2,3,4,5,8,8,9,11,12,14,16,18,21,27,31,38,44)
status<-c(rep(1,16),0,1,0,1)
fit<-survfit(Surv(time,status)~1)
plotbands(fit,xlab="Time (in months)",ylab="Probability")

## Repeat the same calculations, but require only 80% confidence
plotbands(fit,0.80,xlab="Time (in months)",ylab="Probability")

Example output

Loading required package: survival
The critical value required is  0.4557255 
The critical value required is  0.2986889 

kmconfband documentation built on May 2, 2019, 2:49 p.m.