Description Usage Arguments Value See Also Examples
View source: R/hazardratioFns.R
Time-dependent Cox regression for the cause-specific model.
1 | hr.tv.causespecific(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. |
hr.naive
, hr.tv.subdistribution
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 27 28 29 30 31 32 33 34 35 36 | ##---- 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 = "")
y.alive <- Surv(tvdata$tstart, tvdata$tstop, tvdata$status ==
1)
fit.alive.timeonly <- summary(coxph(y.alive ~ cluster(id) +
inf, data = tvdata))
fit.alive.full <- summary(coxph(y.alive ~ cluster(id) + age +
sex + Tai + other + head + cath + surgical + strata(prem) +
cancer + hes_neocaredescription + hes_admimethdescription +
hes_admisorcdescription + inf, data = tvdata))
y.dead <- Surv(tvdata$tstart, tvdata$tstop, tvdata$status ==
2)
fit.dead.timeonly <- summary(coxph(y.dead ~ cluster(id) +
inf, data = tvdata))
fit.dead.full <- summary(coxph(y.dead ~ cluster(id) + age +
sex + Tai + other + head + cath + surgical + strata(prem) +
cancer + hes_neocaredescription + hes_admimethdescription +
hes_admisorcdescription + inf, data = tvdata))
y.both <- Surv(tvdata$tstart, tvdata$tstop, tvdata$status !=
0)
fit.both.timeonly <- summary(coxph(y.both ~ cluster(id) +
inf, data = tvdata))
fit.both.full <- summary(coxph(y.both ~ 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,
fit.both.timeonly = fit.both.timeonly, fit.both.full = fit.both.full))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.