This function computes estimates of the conditional probability function of a competing event and its variance. It also tests equality of conditional probability functions in two samples.
cpf(formula, data, subset, na.action, conf.int = 0.95, failcode)
A formula object that has a 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 function.
A data frame in which the variables in the formula can be interpreted.
Expression identifying a subset of the data to be used for conditional probability estimation.
A missing-data filter function, applied to the model
frame, after any subset
argument has been used. Default
option is options()$na.action
.
Level for pointwise two-sided confidence intervals. Default is 0.95.
Failure code of the event of interest. Default is the smallest event type provided in the data.
cpf
returns an object of class cpf
with components
Estimates of the conditional probability function given at all event times
Variance estimates
Event times
Lower confidence limit for the conditional probability curve
Upper confidence limit for the conditional probability curve
Number of individuals at risk just before \(t\)
A matrix giving the number of events of interest at time \(t\) in the first column, and the number of competing events at time \(t\) in the second column
Number of censored observations at time \(t\)
Displays the size of each strata
Gives covariate's name and labels
Gives the covariate labels that will be used by default for plotting the conditional probability curves, for example.
Call that produced the object
Test statististic
p value of the test
Same as in function call
The conditional probability function is defined as the probability of having failed due to one competing event (the event of interest), given that no other event has previously occurred (Pepe, 1993).
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.
M.S. Pepe and M. Mori, Kaplan-Meier, marginal or conditional probability curves in summarizing competing risks failure time data? Statistics in Medicine, 12(8):737--751.
A. Allignol, A. Latouche, J. Yan and J.P. Fine (2011). A regression model for the conditional probability of a competing event: application to monoclonal gammopathy of unknown significance. Journal of the Royal Statistical Society: Series C, 60(1):135--142.
# NOT RUN {
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