cv.ncvsurv(X, y, ..., cluster, nfolds=10, seed, returnY=FALSE,
trace=FALSE)
ncvsurv
.ncvsurv
.ncvsurv
.cv.ncvsurv
can be run in parallel across a
cluster using the parallel
package. The cluster must be set
up in advance using the makeCluster
function from that
pacakge. The cluster must then be passed to cv.ncvsurv
(see
example).cv.ncvsurv
return the linear predictors
from the cross-validation folds? Default is FALSE; if TRUE, this
will return a matrix in which the element for row i, column j is the
fitted value for observation i from the fold in which observation i
was excluded from the fit, at the jth value of lambda. NOTE: The
rows of Y
are ordered by time on study, and therefore do not
correspond to the original order of observations pased to
cv.ncvsurv
."cv.ncvsurv"
inheriting from
"cv.ncvreg"
and containing: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 of calculating
the full Cox partial likelihood using the cross-validated set of
linear predictors. Unfortunately, using this approach there is no
clear way (yet) of determining standard errors, so cv.ncvsurv
,
unlike cv.ncvreg
, does not provide any. Other approaches to cross-validation for the Cox regression model have
been proposed; the strenghts and weaknesses of the various methods for
penalized regression in the Cox model are not well understood.
Because of this, the approach used by cv.ncvsurv
may change in
the future as additional research is carried out.
ncvsurv
, plot.cv.ncvreg
, summary.cv.ncvreg
data(Lung)
X <- Lung$X
y <- Lung$y
cvfit <- cv.ncvsurv(X, y)
summary(cvfit)
plot(cvfit)
plot(cvfit, type="rsq")
## requires loading the parallel package
## Not run:
# library(parallel)
# cl <- makeCluster(4)
# cvfit <- cv.ncvsurv(X, y, cluster=cl)## End(Not run)
Run the code above in your browser using DataLab