Learn R Programming

mets (version 1.3.11)

cif: Cumulative Incidence with Robust Standard Errors

Description

Computes cumulative incidence functions with robust standard errors.

Usage

cif(formula, data = data, cause = 1, cens.code = 0, death.code = NULL, ...)

Value

An object of class "cif" (extends "phreg") containing:

cumhaz

Cumulative incidence estimates.

se.cumhaz

Standard errors.

cause

Cause of interest.

Arguments

formula

Formula with 'Event' outcome and strata (only!).

data

Data frame.

cause

Cause of interest (default is NULL, which looks at all causes).

cens.code

Censoring code (default is "0").

death.code

Alternative to cens.code; specifies codes of death.

...

Additional arguments passed to lower-level functions.

Author

Thomas Scheike

Examples

Run this code
data(bmt)
bmt$cluster <- sample(1:100, 408, replace = TRUE)
out1 <- cif(Event(time, cause) ~ +1, data = bmt, cause = 1)
out2 <- cif(Event(time, cause) ~ +1 + cluster(cluster), data = bmt, cause = 1)

par(mfrow = c(1, 2))
plot(out1, se = TRUE)
plot(out2, se = TRUE)

Run the code above in your browser using DataLab