Learn R Programming

Cprob (version 1.2.2)

cpf: Conditional Probability Function of a Competing Event

Description

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.

Usage

cpf(formula, data, subset, na.action, conf.int = 0.95, failcode)

Arguments

formula
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 funct
data
A data frame in which the variables in the formula can be interpreted.
subset
Expression identifying a subset of the data to be used for conditional probability estimation.
na.action
A missing-data filter function, applied to the model frame, after any subset argument has been used. Default option is options()$na.action.
conf.int
Level for pointwise two-sided confidence intervals. Default is 0.95.
failcode
Failure code of the event of interest. Default is the smallest event type provided in the data.

Value

  • cpf returns an object of class cpf with components
  • cpEstimates of the conditional probability function given at all event times
  • varVariance estimates
  • timeEvent times
  • lowerLower confidence limit for the conditional probability curve
  • upperUpper confidence limit for the conditional probability curve
  • n.riskNumber of individuals at risk just before $t$
  • n.eventA 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
  • n.lostNumber of censored observations at time $t$
  • size.strataDisplays the size of each strata
  • XGives covariate's name and labels
  • strataGives the covariate labels that will be used by default for plotting the conditional probability curves, for example.
  • callCall that produced the object
  • zTest statististic
  • pp value of the test
  • failcodeSame as in function call

Details

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.

References

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.

See Also

Hist, print.cpf, summary.cpf, plot.survfit

Examples

Run this code
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