library(ALassoSurvIC)
### Getting the unpenalized NPMLE for interval censored data
data(ex_IC)
lowerIC <- ex_IC$lowerIC
upperIC <- ex_IC$upperIC
X <- ex_IC[, -c(1:2)]
system.time(result <- unpencoxIC(lowerIC, upperIC, X))
result # main result
baseline(result) # obtaining the baseline cumulative hazard estimate
plot(result) # plotting the estimated baseline cumulative hazard function by default
plot(result, what = "survival") # plotting the estimated baseline survival function
## Use the parallel computing to reduce computational times
library(parallel)
cl <- makeCluster(2L) # making the cluster object 'cl' with two CPU cores
system.time(result <- unpencoxIC(lowerIC, upperIC, X, cl = cl))
on.exit()
### Getting the unpenalized NPMLE for interval censored and left truncated data
## Try following codes with the 'ex_ICLT' data example
data(ex_ICLT)
lowerIC <- ex_ICLT$lowerIC
upperIC <- ex_ICLT$upperIC
trunc <- ex_ICLT$trunc
X <- ex_ICLT[, -c(1:3)]
result2 <- unpencoxIC(lowerIC, upperIC, X, trunc)
result2
baseline(result2)
plot(result2)
plot(result2, what = "survival")
Run the code above in your browser using DataLab