Function for predicting the (excess) hazard and the corresponding
(net) survival from
a model fitted with the mexhaz
function for a particular vector
of covariates. If the survival model
was fitted with an expected hazard, the estimates obtained are excess
hazard and net survival estimates. When the model includes a random
effect, the predicted values are obtained for the value 0 of the
random effect. Confidence limits
can be obtained by MonteCarlo simulation (for all types of baseline
hazard) and by the Delta Method (not available for Weibull hazard).
This function allows the computation of the hazard and the survival at
one time point for several vectors of covariables or for one vector of
covariables at
several time points.
1 2  predMexhaz(model, time.pts, data.val = data.frame(.NotUsed=NA),
conf.int=c("none","delta","simul"), nb.sim = 10000)

model 
an object of class 
time.pts 
a vector of numerical values representing the time points at which predictions are requested. Time values greater than the maximum followup time on which the model estimation was based are discarded. 
data.val 
a 
conf.int 
method to be used to compute confidence limits. Selection can be made between the following options:

nb.sim 
integer value representing the number of simulations
used to estimate the 95% confidence limits for the (excess) hazard and the (net) survival. This argument is used only if 
An object of class predMexhaz
that can be used by
the functions plot.predMexhaz
and points.predMexhaz
to produce graphics of the (excess) hazard and
the (net) survival. It contains the following elements:
call 
the 
results 
a 
variances 
a 
type 
the type of predictions produced. Can take the value

ci.method 
the method used to compute confidence limits. 
nb.sim 
number of simulations used to estimate the 95% confidence
limits (set to 
Hadrien Charvat, Aurelien Belot
Charvat H, Remontet L, Bossard N, Roche L, Dejardin O, Rachet B, Launoy G, Belot A; CENSUR Working Survival Group. A multilevel excess hazard model to estimate net survival on hierarchical data allowing for nonlinear and nonproportional effects of covariates. Stat Med 2016. (doi: 10.1002/sim.6881)
print.predMexhaz
, plot.predMexhaz
, points.predMexhaz
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  data(simdatn1)
## Fit of a fixedeffect hazard model, with the baseline hazard
## described by a linear Bspline with two knots at 1 and 5 year and with
## effects of age (agecr), deprivation index (depindex) and sex (IsexH)
Mod_bs1_2 < mexhaz(formula=Surv(time=timesurv,
event=vstat)~agecr+depindex+IsexH, data=simdatn1, base="exp.bs",
degree=1, knots=c(1,5), verbose=0)
## Prediction at several time points for one vector of covariates
Pred_Modbs1_2A < predMexhaz(Mod_bs1_2, time.pts=seq(0.1,10,by=0.1),
data.val=data.frame(agecr=0,depindex=0.5,IsexH=1), conf.int="delta")
## Prediction for several vectors of covariates at one time point
Pred_Modbs1_2B < predMexhaz(Mod_bs1_2, time.pts=10,
data.val=data.frame(agecr=c(0.2,0.1,0), depindex=c(0.5,0.5,0.5),
IsexH=c(1,1,1)), conf.int="delta")
## Prediction for all individuals of the study population at one time point
Pred_Modbs1_2C < predMexhaz(Mod_bs1_2, time.pts=10,
data.val=simdatn1, conf.int="delta")

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.