cpf: Conditional Probability Function of a Competing Event

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

View source: R/cpf.R

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

1
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 function.

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.

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.

Value

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 t

n.event

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

n.lost

Number of censored observations at time t

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

Author(s)

Arthur Allignol, [email protected]

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

Examples

 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

Example output

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

Cprob documentation built on May 23, 2018, 1:05 a.m.