R/se-ncvsurv.R

# Bootstrap method for calculating CVSE for Cox models
se.ncvsurv <-function (y, eta, B = 100) {
  cve <- matrix(NA, B, ncol(eta))
  for (b in 1:B) {
    ind <- sample(1:nrow(eta), replace=TRUE)
    cve[b,] <- loss.ncvsurv(y[ind,], eta[ind,])
  }
  apply(cve, 2, sd)
}

Try the ncvreg package in your browser

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

ncvreg documentation built on April 25, 2023, 5:11 p.m.