hr.tv.causespecific: Time-dependent Cox regression for the cause-specific model

Description Usage Arguments Value See Also Examples

View source: R/hazardratioFns.R

Description

Time-dependent Cox regression for the cause-specific 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.naive, hr.tv.subdistribution

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

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