library(ALassoSurvIC)
### Variable selection for interval censored data
data(ex_IC) # the 'ex_IC' data having 100 subjects and 6 covariates
lowerIC <- ex_IC$lowerIC
upperIC <- ex_IC$upperIC
X <- ex_IC[, -c(1:2)]
## Performing the variable selection algorithm using a single core
system.time(result <- alacoxIC(lowerIC, upperIC, X))
## Use parallel computing to reduce the computation time
library(parallel)
cl <- makeCluster(2L) # making the cluster object 'cl' with two CPU cores
system.time(result <- alacoxIC(lowerIC, upperIC, X, cl = cl))
result # main result
baseline(result) # obtaining the baseline cumulative hazard estimate
plot(result) # plotting the baseline estimated cumulative hazard function by default
plot(result, what = "survival") # plotting the estimated baseline survival function
on.exit()
### Variable selection for interval censored and left truncated data
## Try following codes with the 'ex_ICLT' data example
data(ex_ICLT) # the 'ex_ICLT' data having 100 subjects and 6 covariates
lowerIC <- ex_ICLT$lowerIC
upperIC <- ex_ICLT$upperIC
trunc <- ex_ICLT$trunc
X <- ex_ICLT[, -c(1:3)]
result2 <- alacoxIC(lowerIC, upperIC, X, trunc)
result2
baseline(result2)
plot(result2)
plot(result2, what = "survival")
Run the code above in your browser using DataLab