-
Notifications
You must be signed in to change notification settings - Fork 0
An R-package to perform stagewise pseudo-value regression in a competing risk setting.
License
danielazoeller/PseudoBoost
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# PseudoBoost In a competing risk setting the CIF for the interesting risk can be calculated at a grid of time. For this values a stagewise boosting algortihm is performed, whereas the variable selection is coupled between time points but the estimates may differ. Consequently this allows to estimate time-varying effects, which can be smoothed over time. Addionally, confidence bands can be calculated. ## Installation To install the development version for the package PseudoBoost, please start a current version of R and type (using devtools): ```{r,eval=FALSE} # currently this can be done via github install.packages("devtools") #if needed devtools::install_github("danielazoeller/PseudoBoost") ``` ## Program call example For example, the call is as follows: Firstly, we simulate data for 400 individuals with 10 binomially distributed covariates with 2 competing risks. These covarites do not have an effect on the second, uninteresting competing risk and only 4 have an effect on the first, interesting risk. This effect changes at t=0.1. Before this time point, only X1 and X2 have an effect, afterwards only X3 and X4. For the call the status, the observations time and the observed covariates are needed. ```{r, eval=FALSE} library(PseudoBoost) n <- 400; p <- 10 beta <- c(c(1,-1),rep(0,p-2)) beta2 <- c(c(0,0,1,-1),rep(0,p-4)) xmat <- matrix(1*(rbinom(n*p,1,0.5)),n,p) real.time <- -(log(runif(n)))/(1*exp(drop(xmat %*% beta))) real.time2 <- -(log(runif(n)))/(1*exp(drop(xmat %*% beta2))) real.time <- ifelse(real.time > 0.1,0.1+real.time2,real.time) cens.time <- rexp(n,rate=1/1) second.time <- rexp(n,rate=1/1) status <- ifelse(real.time <= cens.time,1,0) obs.time <- ifelse(real.time <= cens.time,real.time,cens.time) status <- ifelse(obs.time <= second.time,status,2) obs.time <- ifelse(obs.time <= second.time,obs.time,second.time) ``` To evaluate this data, we use a grid of time with 50 time points based on the quantils of the observed events of both risks. ```{r, eval=FALSE} eval.times <- quantile(obs.time[status != 0],seq(from=0.1,to=0.9,length=50)) ``` To calculated the estimates, the call using cross-validation with a maximum number of boostings steps of 250 and a penalty term of 0.1 is as follows: ```{r, eval=FALSE} #Estimates - Unsmooth res_unsmooth <- smoothPseudoBoost(as.data.frame(cbind(obs.time,status)),xmat,times=eval.times, stepno = 100, maxstepno = 250, nu = 0.1, cv = TRUE, multicore = TRUE, RepSmooth = 0, smooth_para = 0, trace = TRUE) #Estimates - Smooth res_unsmooth <- smoothPseudoBoost(as.data.frame(cbind(obs.time,status)),xmat,times=eval.times, stepno = 100, maxstepno = 250, nu = 0.1, cv = TRUE, multicore = TRUE, RepSmooth = 20, smooth_para = 0.001, trace = TRUE) ``` Confidence bands can be calculated, too. Note that this can be computaninally very expensive. ```{r, eval=FALSE} #Confidence bands - Unsmooth res_cb_unsmooth <- cbSmoothPseudoBoost(as.data.frame(cbind(obs.time,status)),xmat,times=eval.times, stepno = 100, maxstepno = 250, nu = 0.1, cv = TRUE, multicore = TRUE, RepSmooth = 0, smooth_para = 0, trace = TRUE, RepCb=1000,cv_est=FALSE) #Confidence bands - Smooth res_cb_smooth <- cbSmoothPseudoBoost(as.data.frame(cbind(obs.time,status)),xmat,times=eval.times, stepno = 100, maxstepno = 250, nu = 0.1, cv = TRUE, multicore = TRUE, RepSmooth = 20, smooth_para = 0.001, trace = TRUE, RepCb=1000,cv_est=FALSE) ``` ## Contact For additional details regarding the functions of PseudoBoost, please consult the documentation or write an e-mail to [email protected].
About
An R-package to perform stagewise pseudo-value regression in a competing risk setting.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published