predict.coxph(object, newdata, type=c("lp", "risk", "expected", "terms"),
se.fit=F, terms=labels.lm(object), collapse)
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).
TRUE, pointwise standard errors are produced for the predictions.
terms, this argument can be used to specify which terms should be
included; the default is all.
fit) and their standard errors (element
se.fit) if the
se.fit
option is TRUE.
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.
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