Learn R Programming

compeir (version 1.0)

cif: Parametrically estimating the cumulative incidence function

Description

This function estimates the cumulative incidence function (CIF) for each respective event type using all competing events incidence rates.

Usage

cif(irates, t, event.code = NULL, covar.code = NULL, full.sample = FALSE)

Arguments

irates
irates object
t
A vector of timepoints for which the CIF shall be calculated
event.code
A character or numerical value that specifies the respective competing events for which the CIF shall be calculated. If NULL, event.code will be inherited from irates
covar.code
A character or numerical value that specifies the respective covariate vlaues for which the CIF shall be calculated. If NULL, covar.code will be inherited from irates
full.sample
A logical value that specifies if the CIF shall also be calculated for the full sample, i.e., irrespective of any covariate value. Default is set to FALSE

Value

An object of class cif. This object is implemented as a list of the (besides pre-specified) following items:
t
Timepoints for which the CIF is calculated
cif
CIF estimates corresponding to t for each event.code

Details

The cumulative incidence function is the expected proportion of type h events over the course of time.

References

Grambauer, N., Schumacher, M., Dettenkofer, M. and Beyersmann, J. (2010) Incidence densities in a competing events setting. American Journal of Epidemiology 172,1077--1084. http://aje.oxfordjournals.org/lookup/doi/10.1093/aje/kwq246

See Also

irates, CIFplot

Examples

Run this code
### Example data.frame with aggregated count data
dat <- data.frame(
			times = c(7948,2899), 
			no.event = c(6,8), 
			event.1 = c(589,68), 
			event.2 = c(55,21), 
			row.names = c("covar0","covar1"))  

### Compute irates object from dat
ir <- irates(dat)

### Compute the cumulative incidence function from irates object, e.g.
cif(irates = ir, t = 1:10)

Run the code above in your browser using DataLab