estimate_cuminc: Competing Events Cumulative Incidence

View source: R/estimate_cuminc.R

estimate_cumincR Documentation

Competing Events Cumulative Incidence

Description

Function creates a cumulative incidence object using the tidycmprsk::cuminc() function.

Usage

estimate_cuminc(
  data = NULL,
  strata = NULL,
  CNSR = "CNSR",
  AVAL = "AVAL",
  conf.int = 0.95,
  ...
)

Arguments

data

A data frame. The dataset is expected to have one record per subject per analysis parameter. Rows with missing observations included in the analysis are removed.

AVAL, CNSR, strata

These arguments are used to construct a formula to be passed to tidycmprsk::cuminc(formula=).

  • AVAL Analysis value for Time-to-Event analysis. Default is "AVAL", as per CDISC ADaM guiding principles.

  • CNSR Column name indicating the outcome and censoring statuses. Column must be a factor and the first level indicates censoring, the next level is the outcome of interest, and the remaining levels are the competing events. Default is "CNSR"

  • strata Character vector, representing the strata for Time-to-Event analysis. When NULL, an overall analysis is performed. Default is NULL.

conf.int

Confidence internal level. Default is 0.95. Parameter is passed to tidycmprsk::cuminc(conf.level=)

...

Additional argument passed to tidycmprsk::cuminc()

Value

A cumulative incidence object as explained at https://mskcc-epi-bio.github.io/tidycmprsk/reference/cuminc.html

Examples

cuminc <-
  visR::estimate_cuminc(
    data = tidycmprsk::trial,
    strata = "trt",
    CNSR = "death_cr",
    AVAL = "ttdeath"
  )
cuminc

cuminc %>%
  visR::visr() %>%
  visR::add_CI() %>%
  visR::add_risktable(statlist = c("n.risk", "cum.event"))

visR documentation built on May 29, 2024, 11:50 a.m.