broom_methods_cuminc | R Documentation |
Broom methods for tidy cuminc objects
## S3 method for class 'tidycuminc'
tidy(x, times = NULL, conf.int = TRUE, conf.level = x$conf.level, ...)
## S3 method for class 'tidycuminc'
glance(x, ...)
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 |
conf.level |
Level of the confidence interval. Default matches that in
|
... |
not used |
a tibble
tidy()
data frameThe returned tidy()
data frame returns the following columns:
Column Name | Description |
outcome | Competing Event Outcome |
time | Numeric follow-up time |
estimate | Risk estimate |
std.error | Standard Error |
n.risk | Number at risk at the specified time |
n.event | If 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.censor | If 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.event | Cumulative number of events at specified time |
cum.censor | Cumulative 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]
.
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.
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.
Other cuminc() functions:
cuminc()
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 = "(.*)_(.*)"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.