Learn R Programming

kmconfband (version 0.1)

cover: Calculate the Exact Coverage Probability of a Nonparametric Confidence Band for the Survivor Function

Description

This function computes the exact coverage probability of a specified nonparametric confidence band for the population survivor function derived from a single-sample Kaplan-Meier estimate

Usage

cover(x,sobj)

Arguments

x
scalar, a quantile of the exact null distribution.
sobj
a one-sample Kaplan-Meier estimate, provided in the form of a survfit.object.

Value

The function returns the calculated value of the coverage probability for the exact nonparametric confidence band, derived from the single-sample Kaplan-Meier estimate, that corresponds to quantile x

Details

The function uses the current value of the scalar x to calculate the lower and upper limits corresponding to each distinct value of the sample-specific Kaplan-Meier estimate, via the function exact. If there are $k$ changes of value in the Kaplan-Meier estimate, there will be $k+1$ pairs of limits. Then, using $k$ ordered, uniform intervals derived from these $k+1$ pairs, the coverage probability that corresponds to the current value of x is evaluated using Noe's recursions, via the function noe

See Also

confband, exact, noe

Examples

Run this code
## Calculate the coverage probability for an exact, nonparametric confidence 
## band for leukemia patient remission experience based on data from 20 
## patients receiving Treatment B when the value of x is 0.3
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)
cover(0.3,fit)

Run the code above in your browser using DataLab