An R package for high dimensional survival analysis
Install directly from CRAN
install.packages("survival.svb")
or using devtools
::install_github("mkomod/survival.svb") devtools
<- 200 # number of sample
n <- 1000 # number of features
p <- 10 # number of non-zero coefficients
s <- 0.4 # degree of censoring
censoring_lvl
# generate some test data
set.seed(1)
<- sample(c(runif(s, -2, 2), rep(0, p-s)))
b <- matrix(rnorm(n * p), nrow=n)
X <- log(1 - runif(n)) / -exp(X %*% b)
Y <- runif(n) > censoring_lvl # 0: censored, 1: uncensored
delta !delta] <- Y[!delta] * runif(sum(!delta)) # rescale censored data
Y[
# fit the model
<- survival.svb::svb.fit(Y, delta, X)
f
# plot the results
plot(b, xlab=expression(beta), main="Coefficient value", pch=8, ylim=c(-2,2))
points(f$m * f$g, pch=20, col=2)
legend("topleft", legend=c(expression(beta), expression(hat(beta))),
pch=c(8, 20), col=c(1, 2))
https://arxiv.org/abs/2112.10270