finegray2 | R Documentation |
finegray2
Fit multiple finegray
models.
finegray2(formula, data, cencode, ...)
formula |
a standard model formula, with survival on the left and covariates on the right |
data |
a data frame containing the variables in |
cencode |
optional censor code; if missing, the censor code will be guessed from the status variable |
... |
additional arguments passed to |
## example from survival::finegray
mg <- within(mgus2, {
etime <- ifelse(pstat == 0, futime, ptime)
event <- ifelse(pstat == 0, 2 * death, 1)
event <- factor(event, 0:2, c('censor', 'pcm', 'death'))
})
pdata <- finegray(Surv(etime, event) ~ age + sex, data = mg)
coxph(Surv(fgstart, fgstop, fgstatus) ~ age + sex,
weight = fgwt, data = pdata)
fg <- finegray2(Surv(etime, event) ~ age + sex, data = mg)
fg$pcm
## use the call and data to evaluate the equivalent coxph model
eval(fg$pcm$call, list(fgdata = fg$pcm$fgdata))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.