Predictions from a coxph Object.

DESCRIPTION:

Creates predicted values from a coxph fit.

USAGE:

predict.coxph(object, newdata, type=c("lp", "risk", "expected", "terms"),
              se.fit=F, terms=labels.lm(object), collapse)

REQUIRED ARGUMENTS:

object
the results of a coxph fit.

OPTIONAL ARGUMENTS:

newdata
data for prediction. If absent predictions are for the subjects used in the original fit.
type
the type of predicted value. Choices are the linear predictor ( lp), the risk score exp(lp) ( risk), the expected number of events given the covariates and follow-up time ( expected), and the terms of the linear predictor ( terms).
se.fit
if TRUE, pointwise standard errors are produced for the predictions.
terms
if type= terms, this argument can be used to specify which terms should be included; the default is all.
collapse
optional vector of subject identifiers. If specified, the output will contain one entry per subject rather than one entry per observation.

VALUE:

a vector or matrix of predictions, or a list containing the predictions (element fit) and their standard errors (element se.fit) if the se.fit option is TRUE.

DETAILS:

This function is a method for the generic function predict for class coxph. It can be invoked by calling predict for an object of the appropriate class, or by calling predict.coxph directly.

SEE ALSO:

, .

EXAMPLES:

fit <- coxph(Surv(time, status) ~ age + ph.ecog + strata(inst), lung,
             na.action='na.omit')
predict(fit, type='expected')
# Those predictions exclude observations with missing values
fit$y[,2] - predict(fit, type='expected') #Martingale residual