##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (midts, rates, tmvar = "t", offsetvar = "", ...)
{
log.smoother <- splinefunx(midts, log(rates), constant.right = TRUE)
haz <- function(newdata) {
t <- newdata[[tmvar]] + (if (offsetvar != "")
newdata[[offsetvar]]
else 0)
exp(log.smoother(t))
}
structure(list(haz = haz), class = "smoothpwc")
}
Run the code above in your browser using DataLab