inst/tinytest/cv-grpsurv.R

.test = "Cross-validation: cox"
n <- 50
group <- rep(0:3,4:1)
p <- length(group)
X <- matrix(rnorm(n*p),ncol=p)
y <- cbind(rexp(n, exp(X[,5] + X[,7])), rep(0:1, c(10, n-10)))
cvfit <- cv.grpsurv(X, y, group, penalty='grLasso')
cvfit <- cv.grpsurv(X, y, group, penalty='gel')
cvfit <- cv.grpsurv(X, y, group, penalty='grLasso', nfolds=50)
cvfit <- cv.grpsurv(X, y, group, penalty='gel', nfolds=50)
cvfit <- cv.grpsurv(X, y, group, penalty='grLasso', se='bootstrap')
cvfit <- cv.grpsurv(X, y, group, penalty='gel', se='bootstrap')
cvfit <- cv.grpsurv(X, y, group, penalty='grLasso', se='bootstrap')

cvfit <- cv.grpsurv(X, y, group, penalty='grLasso')
op <- par(mfrow=c(2,2))
plot(cvfit)
plot(cvfit, type='rsq')
plot(cvfit, type='snr')
par(op)
summary(cvfit)

Try the grpreg package in your browser

Any scripts or data that you put into this service are public.

grpreg documentation built on July 27, 2021, 1:08 a.m.