hr.tv.subdistribution: Time-dependent Cox regression for the subdistribution model

Description Usage Arguments Value See Also Examples

View source: R/hazardratioFns.R

Description

Time-dependent Cox regression for the Fine and Grey subdistribution model.

Usage

1

Arguments

survData

Value

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.

See Also

hr.tv.causespecific, hr.naive

Examples

 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))
  }

n8thangreen/HESmanip documentation built on March 21, 2020, 12:20 a.m.