Displaying 2 results from an estimated 2 matches for "sqcc".
Did you mean:
scc
2018 Jan 18
1
Time-dependent coefficients in a Cox model with categorical variants
...your 3 level categorical variable into two 0/1 dummy variables for a regression matrix. The tt() call is a simple function, however, and ordinary multiplication and does not have those powers. In this case you need to do the setup by hand : create your own 0/1 dummy variables and work with them.
sqcc <- ifelse(dta$Histology == 'Sqcc', 0, 1)
hrac <- ifelse(dta$Histology == 'High risk AC', 0, 1)
fit <- coxph(Surv(time, status) ~ Sex + sqcc + hrac + tt(sqcc) + tt(hrac),
data = dta, tt = list(function(x,t, ...) x*log(t),...
2018 Jan 15
1
Time-dependent coefficients in a Cox model with categorical variants
...like
> head(dta)
Sex tumorsize Histology time status
0 1.5 2 12.1000 0
1 1.8 1 38.4000 0
.....................
Sex: 1 for male; 0 for female., two levels
Histology: 1 for SqCC; 2 for High risk AC; 3 for low risk AC, three levels
Now I need to get a Time-dependent coefficients cox fit:
library(survival)
for(i in c(1,3) dta[,i] <- factor(dta[,i])
fit <-
coxph(
Surv(time, status) ~ Sex + tumorsize + Histology + tt(Histology),
data = dta,
tt = function...