coxph: Adjust for cause-specific analysis
Since the data specifies death as a competing risk, the cox analysis must be adjusted. Death will now, as it was before, treated as a censor.
This commit is contained in:
parent
ac822f48fa
commit
63c2883c7e
2
coxph.R
2
coxph.R
@ -44,7 +44,7 @@ sma_cox_res <- function(m) {
|
|||||||
#
|
#
|
||||||
sma_coxph_univ <- function() {
|
sma_coxph_univ <- function() {
|
||||||
univ_formulas <- sapply(covariates, function(x) as.formula(
|
univ_formulas <- sapply(covariates, function(x) as.formula(
|
||||||
paste('Surv(time_at_risk, time_at_risk_status) ~ ',
|
paste('Surv(time_at_risk, ifelse(time_at_risk_status == 1, 1, 0)) ~ ',
|
||||||
x)))
|
x)))
|
||||||
univ_models <- lapply(univ_formulas,
|
univ_models <- lapply(univ_formulas,
|
||||||
function(x) {coxph(x, data = secmal)})
|
function(x) {coxph(x, data = secmal)})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user