Description Usage Arguments Value See Also Examples
View source: R/hazardratioFns.R
Time-dependent Cox regression for the Fine and Grey subdistribution model.
1 | hr.tv.subdistribution(survData)
|
survData |
fit.disch |
Discharge alive as event of interest. |
fit.dead |
In-hospital death as event of interest. |
fit.both |
Combined end-point of discharged alive and in-hospital death. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (survData)
{
tvdata <- tvCox(survData, type = "alive")
fit.alive.timeonly <- summary(coxph(Surv(tstart, tstop, status ==
1) ~ cluster(id) + inf, data = tvdata))
fit.alive.full <- summary(coxph(Surv(tstart, tstop, status ==
1) ~ cluster(id) + age + sex + Tai + other + head + cath +
surgical + strata(prem) + cancer + hes_neocaredescription +
hes_admimethdescription + hes_admisorcdescription + inf,
data = tvdata))
tvdata <- tvCox(survData, type = "death")
fit.dead.timeonly <- summary(coxph(Surv(tstart, tstop, status ==
2) ~ cluster(id) + inf, data = tvdata))
fit.dead.full <- summary(coxph(Surv(tstart, tstop, status ==
2) ~ cluster(id) + age + sex + Tai + other + head + cath +
surgical + strata(prem) + cancer + hes_neocaredescription +
hes_admimethdescription + hes_admisorcdescription + inf,
data = tvdata))
return(list(fit.alive.timeonly = fit.alive.timeonly, fit.alive.full = fit.alive.full,
fit.dead.timeonly = fit.dead.timeonly, fit.dead.full = fit.dead.full))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.