hr.naive: Time-independent Cox regression

Description Usage Arguments Value See Also Examples

View source: R/hazardratioFns.R

Description

Time-independent Cox regression for alternative models.

Usage

1
hr.naive(survData)

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.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
##---- 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) 
{
    survData$spectime <- ifelse(is.na(survData$spectime), 0, 
        survData$spectime)
    cov <- paste(c(names(survData)[1:17], "age", "gender", "infstatus"), 
        collapse = "+")
    fit.disch <- summary(coxph(Surv(time, 1 - as.logical(event)) ~ 
        age + gender + Tai + other + head + cath + surgical + 
            prem + cancer + hes_neocaredescription + hes_admimethdescription + 
            hes_admisorcdescription + infstatus, data = survData))
    survData$event[survData$missingType == 0] <- FALSE
    fit.dead <- summary(coxph(Surv(time, as.logical(event)) ~ 
        age + gender + Tai + other + head + cath + surgical + 
            prem + cancer + hes_neocaredescription + hes_admimethdescription + 
            hes_admisorcdescription + infstatus, data = survData))
    fit.both <- summary(coxph(Surv(time, missingType) ~ age + 
        gender + Tai + other + head + cath + surgical + prem + 
        cancer + hes_neocaredescription + hes_admimethdescription + 
        hes_admisorcdescription + infstatus, data = survData))
    return(list(fit.disch = fit.disch, fit.dead = fit.dead, fit.both = fit.both))
  }

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