Description Usage Arguments Examples
View source: R/competingrisks.R
These functions override the crr
function provided in cmprsk
to produce more manageable competing risks model results (i.e. include
model.frame and formula in output) so that results can leverage functions
like broom::tidy
the same way other regression function results do.
1 2 3 4 5 6 7 |
formula |
formula object with response on the left of a ~ operator and terms on the right. Event variable can have multiple levels for use in competing risks. |
data |
a data.frame in which to interpret the variables named in the
|
... |
Arguments passed on to
|
1 2 3 4 5 6 7 8 9 10 11 12 | trial <- na.omit(trial)
#original crr
covars <- model.matrix(~ age + factor(trt) + factor(grade), trial)[,-1]
ftime1 <- trial$ttdeath
fstatus1 <- trial$death_cr
mod_orig <- crr(ftime=ftime1,
fstatus = fstatus1,
cov1 = covars)
# using new wrapper function, accepts data and formula
mod_new <- crr(Surv(ttdeath, death_cr) ~ age + trt + grade, trial)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.