Learn R Programming

survPen (version 1.3.0)

predict.survPen: Hazard and Survival prediction from fitted survPen model

Description

Takes a fitted survPen object and produces hazard and survival predictions given a new set of values for the model covariates.

Usage

# S3 method for survPen
predict(object, newdata, n.legendre = 50,
  conf.int = 0.95, do.surv = TRUE, type = "standard",
  exclude.random = FALSE, get.deriv.H = FALSE, ...)

Arguments

object

a fitted survPen object as produced by survPen.fit

newdata

data frame giving the new covariates value

n.legendre

number of nodes to approximate the cumulative hazard by Gauss-Legendre quadrature; default is 50

conf.int

numeric value giving the precision of the confidence intervals; default is 0.95

do.surv

If TRUE, the survival and its lower and upper confidence values are computed. Survival computation requires numerical integration and can be time-consuming so if you only want the hazard use do.surv=FALSE; default is TRUE

type,

if type="lpmatrix" returns the design matrix (or linear predictor matrix) corresponding to the new values of the covariates; default is "standard" for classical hazard and survival estimation

exclude.random

if TRUE all random effects are set to zero; default is FALSE

get.deriv.H

if TRUE, the derivatives wrt to the regression parameters of the cumulative hazard are returned; default is FALSE

...

other arguments

Value

List of objects:

haz

hazard predicted by the model

haz.inf

lower value for the confidence interval on the hazard based on the Bayesian covariance matrix Vp (Wood et al. 2016)

haz.sup

Upper value for the confidence interval on the hazard based on the Bayesian covariance matrix Vp

surv

survival predicted by the model

surv.inf

lower value for the confidence interval on the survival based on the Bayesian covariance matrix Vp

surv.sup

Upper value for the confidence interval on the survival based on the Bayesian covariance matrix Vp

deriv.H

derivatives wrt to the regression parameters of the cumulative hazard. Useful to calculate standardized survival

Details

The confidence intervals noted CI.U are built on the log cumulative hazard scale U=log(H) (efficient scale in terms of respect towards the normality assumption) using Delta method. The confidence intervals on the survival scale are then CI.surv = exp(-exp(CI.U))

References

Wood, S.N., Pya, N. and Saefken, B. (2016), Smoothing parameter and model selection for general smooth models (with discussion). Journal of the American Statistical Association 111, 1548-1575

Examples

Run this code
# 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