View source: R/predict.modreg.R
predict.modreg | R Documentation |
Takes a fitted modreg object produced by modreg
and produces predictions. New sets of covariates can by supplied through newdata
.
## S3 method for class 'modreg' predict(object, ...)
object |
The object to plot, must be of class modreg. |
... |
Additional arguments to pass to |
This function is a wrapper for predict.gam
.
A vector or matrix of predictions. For type = "terms"
this is a matrix with a column per term.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.