cuminc_ci: Calculate cumulative incidence & confidence interval

Description Usage Arguments Value References Examples

View source: R/cuminc_ci.R

Description

This function can be used to calculated cumulative incidence estimates for survival data with competing risks. Confidence intervals can be specified for a given level.

Usage

1
2
3
cuminc_ci(ftime, fstatus, group, times = c(12, 24), print_event = 1,
  print_var = F, strata, rho = 0, cencode = 0, subset,
  na.action = na.omit, conf.level = 0.95, digits = 3)

Arguments

ftime

failure time variable

fstatus

variable with distinct codes for different causes of failure and also a distinct code for censored observations

group

estimates will be calculated within groups given by distinct values of this variable. Tests will compare these groups. If missing then treated as all one group (no test statistics)

times

timepoint(s) for which cumulative incidence estimates and confidence intervals are desired

print_event

identifies which event codes should be presented in the results. "all" can be used to request all event types

print_var

logical indicator for whether or not the variance should be listed in the results

strata

stratification variable. Has no effect on estimates. Tests will be stratified on this variable. (all data in 1 stratum, if missing)

rho

Power of the weight function used in the tests.

cencode

value of fstatus variable which indicates the failure time is censored.

subset

a logical vector specifying a subset of cases to include in the analysis

na.action

a function specifying the action to take for any cases missing any of ftime, fstatus, group, strata, or subset.

conf.level

the confidence level for confidence intervals. default is 0.95

digits

number of decimal places that the results should be rounded to

Value

returns a list containing

test

resulting test statistics and p-values

time1

cumulative incidence estimates and ci's for the resquested time

...

...

timeN

estimates for final time point

References

Scrucca L., Santucci A., Aversa F. (2007) Competing risks analysis using

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
df <-
  data.frame(
    fail_time = 12 * rexp(100),
    group = paste0('group_', sample(1:3, 100, replace = TRUE)) ,
    fail_status = sample(0:2, 100, replace = TRUE)
  )

cuminc_ci(
  ftime = df$fail_time,
  fstatus = df$fail_status,
  group = df$group,
  times = 12
)

hild0146/hildenp documentation built on May 17, 2019, 3:58 p.m.