cv.ncvsurv(X, y, ..., nfolds=10, seed, trace=FALSE, events.only=TRUE)ncvsurv.ncvsurv.ncvsurv."cv.ncvsurv" inheriting from
"cv.ncvreg" and containing:lambda, averaged
across the cross-validation folds.cve.ncvsurv object for the whole data.lambda corresponding to
lambda.min.lambda with the minimum
cross-validation error.lambda (i.e., the cross-validated deviance for
max(lambda), unless you have supplied your own lambda
sequence, in which case this quantity is probably not meaningful).
Although the actual null deviance can be calculated, it cannot be
compared with the cross-validated deviance due to the manner in
which deviance must be calculated for Cox regression models (see
details).ncvsurv nfolds times, each time
leaving out 1/nfolds of the data. Because of the
semiparametric nature of Cox regression, cross-validation is not
clearly defined. cv.ncvsurv uses the approach proposed by
Verweij and van Houwelingen (see references), in which the
contribution to the deviance from observation i comes from subtracting
the full-data-set partial likelihood from the leave-one-out partial
likelihood.ncvsurv, plot.cv.ncvreg, summary.cv.ncvregdata(Lung)
X <- Lung$X
y <- Lung$y
cvfit <- cv.ncvsurv(X, y)
summary(cvfit)
plot(cvfit)
plot(cvfit, type="rsq")Run the code above in your browser using DataLab