Description Usage Arguments Value See Also Examples
View source: R/hazardratioFns.R
Time-independent Cox regression for alternative models.
1 | hr.naive(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.tv.causespecific
, 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 | ##---- 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))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.