CRCumInc: Estimation of Cumulative Incidence of competing events

Description Usage Arguments Value Examples

View source: R/CRCumInc.R

Description

Estimation of Cumulative Incidence Functions (CIF) of competing events.

This function is based on the CIF estimated by the survival package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
CRCumInc(
  df,
  time,
  event,
  exposed,
  entry = NULL,
  weights = NULL,
  ipwvars = NULL,
  print.attr = T
)

Arguments

df

A data frame containing, at a minimum, exit, event, and exposure.

time

Name of the column in df containing times of event or censoring.

event

Name of the column in df containing codes for censoring (0) and event types (1-4). Analysis of more than 4 competing events is not supported by this function.

exposed

Name of the column in df containing a binary (0/1) exposure variable for stratification.

entry

Name of the column in df containing late entry times.

weights

Name of the column in df containing user-supplied weights. If ipwvars is utilized, this argument is ignored.

ipwvars

A vector of names of columns in 'df' containing predictor variables for building a propensity score model for exposure and creating standardized inverse probability weights using this model. Overrides the weights argument.

print.attr

A logical indicator for whether results should be returned in console.

Value

A data frame with the following columns:

event

Type of event that occurs at the given time.

exposure

Exposure group in which the event happens.

time

Time of the event.

CIoinc_comp

Value of the unexposed (denoted by “o”) composite cumulative incidence at the given time.

CIxinc_comp

Value of the exposed (denoted by “x”) composite cumulative incidence at the given time.

CIoinc_1

Value of the unexposed cumulative incidence of event 1 at the given time.

CIxinc_1

Value of the exposed cumulative incidence of event 1 at the given time.

R_1

Sub-hazard ratio/Cause-specific hazard ratio for event 1.

R_2

Sub-hazard ratio/Cause-specific hazard ratio for event 2.

Examples

1
2
3
4
#data from the package
data <- hrcomprisk::dat_ckid
#Estimate the Cumulative Incidence Functions and Ratios of sHR and csHR
mydat.CIF<-CRCumInc(df=data, time=exit, event=event, exposed=b1nb0, print.attr=TRUE)

AntiportaD/hrcomprisk documentation built on Jan. 28, 2020, 10:58 p.m.