# NOT RUN {
library(survPen)
data(datCancer) # simulated dataset with 2000 individuals diagnosed with cervical cancer
# model : unidimensional penalized spline for time since diagnosis with 5 knots
f1 <- ~smf(fu,df=5)
# hazard model
mod1 <- survPen(f1,data=datCancer,t1=fu,event=dead,expected=NULL,method="LAML")
# predicting hazard and survival at time 1
pred <- predict(mod1,data.frame(fu=1))
pred$haz
pred$surv
# }
Run the code above in your browser using DataLab