StCI {bpcp}R Documentation

Get survival and confidence interval at t from kmci, kmciLR, or survfit object

Description

Just picks out the survival function and confidence interval in a different way depending on the type of object.

Usage


## Default S3 method:
StCI(x,tstar, afterMax = "continue", ...)


## S3 method for class 'kmciLR'
StCI(x,tstar, ...)

Arguments

x

a kmci or kmciLR object

tstar

a vector of times that you want survival and CI values

afterMax

character, what to do after tmax (see details)

...

further arguments to be passed to or from methods.

Details

Since the Kaplan-Meier estimator is undefined after the last observation if it is censored and many confidence interval methods are not defined there either, we need to explicitly define what to do. (For objects of the kmciLR class, the confidence intervals are defined over the positive real line and the afterMax is ignored.) The afterMax has four options for this: 'continue' (keep surv and ci values the same as the last calculated one), 'zero' (surv and lower go to zero, upper stays same), 'zeroNoNA' (surv and lower go to zero, upper stays same unless it is NA, then it takes on the last non-missing upper value), 'half' (surv goes to half value, lower goes to zero, upper stays same).

Value

The function StCI returns a data frame with the following variables. (It also has an attribute: 'conf.level').

time

this is tstar

survival

survival at tstar

lower

lower confidence limit at tstar

upper

upper confidence limit at tstar

Author(s)

Michael Fay

See Also

kmci, kmciLR

Examples

data(leuk)
## compare to table 1 of Thomas and Grunkmeier (1975)
StCI(kmciTG(leuk$time,leuk$status),c(10,20))

[Package bpcp version 1.4.2 Index]