dynPred  R Documentation 
Calculates individualised conditional survival probabilities for subjects
during a period of followup using a joint
model fit along with requisite longitudinal
process history.
Note that this function is largely designed for use within the ROC function which assesses discriminatory power of the joint model, however it does function by itself with proper use of its arguments.
dynPred(
data,
id,
fit,
u = NULL,
nsim = 200,
progress = TRUE,
scale = NULL,
df = NULL
)
data 
the data to which the original 
id 
subject identifier, i.e. for which subject is the conditional survival probabilities desired? 
fit 
a joint model fit by the 
u 
a numeric 
nsim 
how many Monte Carlo simulations should be carried out? Defaults to

progress 
a logical, if 
scale 
numeric scales the variancecovariance parameter in the proposal distribution for
the MetropolisHastings algorithm. Defaults to 
df 
numeric denotes the degrees of freedom of the proposed 
Dynamic predictions for the timetoevent process based on information available
on the subject's longitudinal process up to given time t
are calculated by Monte Carlo
simulation outlined in Rizopoulos (2011). For a subject last observed at time t
, the
probability that they survive until future time u
is
Pr(T_i \ge u  T \ge t; \boldsymbol{Y}_i, \boldsymbol{b}_i; \boldsymbol{\Omega}) \approx
\frac{S(u\hat{\boldsymbol{b}}_i; \boldsymbol{\Omega})}
{S(t\hat{\boldsymbol{b}}_i; \boldsymbol{\Omega})}
where T_i
is the true failure time for subject i
, \boldsymbol{Y}_i
their
longitudinal measurements up to time t
, and S()
the survival function.
\boldsymbol{\Omega}
is drawn from the multivariate normal distribution with mean
\hat{\boldsymbol{\Omega}}
and its variance taken from a fitted joint
object.
\hat{\boldsymbol{b}}
is drawn from the t
distribution by means of a
MetropolisHastings algorithm with nsim
iterations.
A list of class dynPred
which consists of three items:
pi
A data.frame
which contains each candidate failure time (supplied by
u
), with the mean, median and 2.5% and 97.5% quantiles of probability of survival
until this failure time.
pi.raw
A matrix
of with nsim
rows and length(u)
columns,
each row represents the l
th conditional survival probability of survival each u
survival time. This is largely for debugging purposes.
The acceptance rate of the MetropolisHastings algorithm on the random effects.
James Murray (j.murray7@ncl.ac.uk).
Bernhardt PW, Zhang D and Wang HJ. A fast EM Algorithm for Fitting Joint Models of a Binary Response to Multiple Longitudinal Covariates Subject to Detection Limits. Computational Statistics and Data Analysis 2015; 85; 37–53
Rizopoulos D. Dynamic predictions and prospective accuracy in joint models for longitudinal and timetoevent data. Biometrics 2011; 67: 819–829.
ROC
and plot.dynPred
.
data(PBC)
PBC$serBilir < log(PBC$serBilir)
# Focus in on id 81, who fails at around 7 years of followup. \code{dynPred} allows us to
# infer how the model believes their survival probability would've progressed (ignoring the
# true outcome at start time).
# Univariate 
long.formulas < list(serBilir ~ drug * time + (1 + timeid))
surv.formula < Surv(survtime, status) ~ drug
family < list('gaussian')
fit < joint(long.formulas, surv.formula, PBC, family)
preds < dynPred(PBC, id = 81, fit = fit, u = NULL, nsim = 200,
scale = 2)
preds
plot(preds)
# Bivariate 
# Does introduction of albumin affect conditional survival probability?
long.formulas < list(
serBilir ~ drug * time + I(time^2) + (1 + time + I(time^2)id),
albumin ~ drug * time + (1 + timeid)
)
fit < joint(long.formulas, surv.formula, data = PBC, family = list("gaussian", "gaussian"))
bi.preds < dynPred(PBC, id = 81, fit = fit, u = NULL, nsim = 200,
scale = fit$coeffs$D/sqrt(fit$ModelInfo$n))
bi.preds
plot(bi.preds) # Appears to leveloff dramatically; perhaps indicative of this id's albumin
# levels, or acceleration in serBilir trajectory around 8.5 years.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.