data(colcancer)
colcancer70 <- colcancer[1:70, ]
mc <- modreg.control(tol_opt = 10^-2, tol_opt2 = 10^-2,
tol = 10^-3)
reg <- modreg(Surv(logfollowup, death) ~ sex + s(age, bs = "ps"), data =
colcancer70, control = mc)
ndat <- data.frame(sex = rep(colcancer70$sex[1], 200), age = seq(50, 90, length = 200))
pr <- predict(reg, newdata = ndat)
Run the code above in your browser using DataLab