cpf(formula, data, subset, na.action, conf.int = 0.95, failcode)
Hist
object on the
left of a ~ operator, and if desired, terms separated by + on the
right. Note that any subsetting, i.e., data$var
or
data[, "var"]
, is invalid for this functsubset
argument has been used. Default
option is options()$na.action
.cpf
returns an object of class cpf
with components The cpf
function aims at estimating this quantity along with
its variance at each event times. It also computes a test of
equality of conditional probability curves in two samples (and
only in two samples).
Of note, if there is more than 2 competing events, the failure types that are not of interest are aggregated into one competing event.
Hist
, print.cpf
,
summary.cpf
, plot.survfit
data(mgus)
CP <- cpf(Hist(time, ev), data = mgus)
CP
## With age dichotomised according to its median
mgus$AGE <- ifelse(mgus$age < 64, 0, 1)
CP <- cpf(Hist(time, ev)~AGE, data = mgus)
CP
summary(CP)
## Conditional probability of the competing event
CP.death <- cpf(Hist(time, ev), data = mgus, failcode = 2)
CP.death
Run the code above in your browser using DataLab