############
# Example for resampling and screening main effects by CoxBoost,
# screening interactions by random forest and
# building a final Cox proportional hazards model by CoxBoost:
# system.time with one core:
# user system elapsed
# 399.78 2.40 403.02
# For a faster run set repetitions down!
############
# Create survival data with interactions:
data <- simul.int(518,n = 200, p = 500,
beta.int = 1.0,
beta.main = 0.9,
censparam = 1/20,
lambda = 1/20)[[1]]
set.seed(123)
resamcb <- resample.sprinter( x=data[,1:500],
time = data$obs.time,
status= data$obs.status,
fold = 10,
repetitions = 5,
mandatory = c("ID1","ID2"),
n.inter.candidates = 1000,
screen.main = fit.CoxBoost,
fit.final = fit.CoxBoost,
args.screen.main = list(stepno = 5),
parallel = F)
summary(resamcb)
summary(resamcb, optional = T)
# true coefficients:
# Clin.cov1 Clin.cov2 ID5:ID6 ID7:ID8
# 0.9 -0.9 1 -1
## Example for resampling and screening main effects by CoxBoost,
## screening interactions by random forest and
## building a final Cox proportional hazards model by CoxBoost:
##
##system.time with one core:
## user system elapsed
## 479.55 2.39 482.40
## For a faster run set repetitions down!
# Create survival data with interactions:
data <- simul.int(518,n = 200, p = 500,
beta.int = 1.0,
beta.main = 0.9,
censparam = 1/20,
lambda = 1/20)[[1]]
resamunicox <- resample.sprinter( x=data[,1:500],
time = data$obs.time,
status= data$obs.status,
fold = 10,
repetitions = 10,
mandatory = c("ID1","ID2"),
n.inter.candidates = 1000,
screen.main = fit.uniCox,
fit.final = fit.uniCox,
parallel = FALSE)
summary(resamunicox)
summary(resamunicox, optional = TRUE)
Run the code above in your browser using DataLab