set.seed(0)
n=150
p=200
truerho=0.5
beta <- c(4,4,4,-6*sqrt(2),4/3, rep(0,p-5))
corrmat=diag(rep(1-truerho, p))+matrix(truerho, p, p)
corrmat[,4]=sqrt(truerho)
corrmat[4, ]=sqrt(truerho)
corrmat[4,4]=1
corrmat[,5]=0
corrmat[5,]=0
corrmat[5,5]=1
cholmat=chol(corrmat)
x=matrix(rnorm(p*n, mean=0, sd=1), n, p)
x=x%*%cholmat
myrates <- exp(x%*%beta)
ytrue <- rexp(n, rate = myrates)
cen <- rexp(n, rate = 0.1 )
time <- pmin(ytrue, cen)
status <- as.numeric(ytrue <= cen)
SIScoef <- getfinalSCADcoefCOX(x = x, time = time, status = status,
pickind = 1:5)
Run the code above in your browser using DataLab