Description Usage Arguments Details Value Author(s) References See Also Examples

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.

1 |

`formula` |
A formula object that has a |

`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 |

`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. |

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.

`cpf`

returns an object of class `cpf`

with components

`cp` |
Estimates of the conditional probability function given at all event times |

`var` |
Variance estimates |

`time` |
Event times |

`lower` |
Lower confidence limit for the conditional probability curve |

`upper` |
Upper confidence limit for the conditional probability curve |

`n.risk` |
Number of individuals at risk just before |

`n.event` |
A matrix giving the number of events of interest at
time |

`n.lost` |
Number of censored observations at time |

`size.strata` |
Displays the size of each strata |

`X` |
Gives covariate's name and labels |

`strata` |
Gives the covariate labels that will be used by default for plotting the conditional probability curves, for example. |

`call` |
Call that produced the object |

`z` |
Test statististic |

`p` |
p value of the test |

`failcode` |
Same as in function call |

Arthur Allignol, [email protected]

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
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
``` |

```
Loading required package: prodlim
Call: cpf(formula = Hist(time, ev), data = mgus)
Number of observations: 241
Cause n.event
1 59
other 130
censored 52
Call: cpf(formula = Hist(time, ev) ~ AGE, data = mgus)
Number of observations: 241
Covariate: AGE
levels: 0 1
Cause n.event
1 59
other 130
censored 52
Call: cpf(formula = Hist(time, ev) ~ AGE, data = mgus)
AGE = 0
time n.risk n.event n.event.other cp var lower
1 0.08761123 120 0 1 0.0000000 0.000000000 0.00000000
30 7.83299110 91 1 0 0.1346154 0.001145166 0.06828962
59 16.77207392 61 1 0 0.3478261 0.002546966 0.24891165
88 21.52498289 31 0 0 0.4434477 0.002976608 0.33651538
118 34.10540726 1 0 0 0.7949134 NaN NaN
upper
1 0.0000000
30 0.2009411
59 0.4467405
88 0.5503800
118 NaN
AGE = 1
time n.risk n.event n.event.other cp var lower
1 0.000000 121 0 2 0.00000000 0.0000000000 0.000000000
29 4.969199 87 0 1 0.03370787 0.0003745327 -0.004223017
58 8.832307 58 0 1 0.13636364 0.0018475294 0.052118707
86 15.195072 30 0 1 0.35555556 0.0054491248 0.210874567
115 23.811088 1 0 1 1.00000000 Inf -Inf
upper
1 0.00000000
29 0.07163875
58 0.22060857
86 0.50023654
115 Inf
Call: cpf(formula = Hist(time, ev), data = mgus, failcode = 2)
Number of observations: 241
Cause n.event
2 130
other 59
censored 52
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.