Compute (and plot) predictions of instantaneous risk and of probability of survival
for a model fitted by coxph_mpl
.
# S3 method for coxph_mpl
predict(object,se="M2QM2",type="risk",i=NULL,time=NULL,upper.quantile=.95,...)# S3 method for predict.coxph_mpl
plot(x,...)
a data.frame of class predict.coxph_mpl
with following columns:
'time'
, the prediction time (as defined in argument 'time'
);
'risk'
or 'survival'
, the wished predictions; 'se'
,
the standard error of each prediction; 'lower'
and 'upper'
,
the lower and upper bound of the prediction confidence interval.
an object inheriting from class coxph_mpl
, representing
a fitted Cox proportional hazard model.
a character string indicating a method to build confidence intevals for the predictions.
Possibilites are "H"
, "M2QM2"
and "M2HM2"
.
Refer to the Details Section of coxph_mpl
.
Default is se="M2QM2"
.
character string indicating the type of wished predictions. Possibilies are "risk"
,
for predicted instantaneous risk at time \(t\) (see argument "time"
); and
"survival"
, for predicted probability of survival above time \(t\).
Default is type="risk"
.
an integer indicating the covariate vector of interest (i.e., line of the
X matrix). If i==NULL
, the mean of each covariate will be used.
Default is i=NULL
.
a double-precision vector indicating at which time the preditions should be computed.
If time==NULL
, predictions are computed for 1000 equally spaced times
in the range of the outcomes. Default is time=NULL
.
quantile of the model response defining the upper limit of the x-axis of the
plot of the predictions. This argument is passed through to
plot.predict.coxph_mpl
. Default is upper.quantile=.95
.
an object inheriting from class predict.coxph_mpl
, representing
the prediction of a fitted Cox proportional hazard model.
other parameters to be passed through to printing or plotting functions.
Dominique-Laurent Couturier, Maurizio Manuguerra
The available predictions incorporate the baseline hazard
(instantaneous risk) or cumulated baseline hazard estimate (survival function)
and are thus absolute instead of relative (see predict.coxph
).
Prediction standard errors and confidence intervals are obtained by use of the delta method.
In the plots, the confidence intervals are forced to belong to the parameter range, which is \([0,inf[\) for instantaneous risk, and \([0,1]\) for survival probabilities.
coxph_mpl
, coxph_mpl.control
,
coxph_mpl.object
, residuals.coxph_mpl
and
summary.coxph_mpl
.
if (FALSE) {
data(lung)
fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung)
plot(predict(fit_mpl))
}
Run the code above in your browser using DataLab