# NOT RUN {
library(ggplot2)
# Time-varying covariates
# }
# NOT RUN {
data(heart, package="survival")
# Using a vector of alphas = (0.8, 1)
cv1 <- pcoxtimecv(Surv(start, stop, event) ~ age + year + surgery + transplant
, data = heart
, alphas = c(0.8, 1)
, refit = TRUE
, lamfract = 0.6
, seed = 1234
)
# Plot cross-validation curves
plot(cv1, type = "cve")
# Plot
plot(cv1, type = "fit")
# }
Run the code above in your browser using DataLab