Learn R Programming

tidycmprsk (version 1.1.0)

broom_methods_cuminc: Broom methods for tidy cuminc objects

Description

Broom methods for tidy cuminc objects

Usage

# S3 method for tidycuminc
tidy(x, times = NULL, conf.int = TRUE, conf.level = x$conf.level, ...)

# S3 method for tidycuminc glance(x, ...)

Value

a tibble

Arguments

x

object of class 'tidycuminc'

times

Numeric vector of times to obtain risk estimates at

conf.int

Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to FALSE.

conf.level

Level of the confidence interval. Default matches that in cuminc(conf.level=) (typically, 0.95)

...

not used

<code>tidy()</code> data frame

The returned tidy() data frame returns the following columns:

Column NameDescription
outcomeCompeting Event Outcome
timeNumeric follow-up time
estimateRisk estimate
std.errorStandard Error
n.riskNumber at risk at the specified time
n.eventIf the times= argument is missing, then the number of events that occurred at time t. Otherwise, it is the cumulative number of events that have occurred since the last time listed.
n.censorIf the times= argument is missing, then the number of censored obs at time t. Otherwise, it is the cumulative number of censored obs that have occurred since the last time listed.
cum.eventCumulative number of events at specified time
cum.censorCumulative number of censored observations at specified time

If tidy(time=) is specified, then n.event and n.censor are the cumulative number of events/censored in the interval. For example, if tidy(time = c(0, 12, 18)) is passed, n.event and n.censor at time = 18 are the cumulative number of events/censored in the interval (12, 18].

p-values

The p-values reported in cuminc(), glance.tidycuminc() and add_p.tbl_cuminc() are Gray's test as described in Gray RJ (1988) A class of K-sample tests for comparing the cumulative incidence of a competing risk, Annals of Statistics, 16:1141-1154.

Confidence intervals

The confidence intervals for cumulative incidence estimates use the recommended method in Competing Risks: A Practical Perspective by Melania Pintilie.

$$x^{exp(±z * se / (x * log(x)))}$$

where \(x\) is the cumulative incidence estimate, \(se\) is the standard error estimate, and \(z\) is the z-score associated with the confidence level of the interval, e.g. \(z = 1.96\) for a 95% CI.

See Also

Other cuminc() functions: cuminc()

Examples

Run this code
cuminc <- cuminc(Surv(ttdeath, death_cr) ~ trt, trial)

tidy(cuminc)

glance(cuminc)

# restructure glance to one line per outcome
glance(cuminc) %>%
  tidyr::pivot_longer(
    everything(),
    names_to = c(".value", "outcome_id"),
    names_pattern = "(.*)_(.*)"
  )

Run the code above in your browser using DataLab