Description Usage Arguments Details Value Author(s) References See Also Examples
Calculates predicted values for the longitudinal part of a joint model.
1 2 3 4 
object 
an object inheriting from class 
newdata 
a data frame in which to look for variables with which to predict. 
type 
a character string indicating the type of predictions to compute, marginal or subjectspecific. See Details. 
interval 
a character string indicating what type of intervals should be computed. 
level 
a numeric scalar denoting the tolerance/confidence level. 
idVar 
a character string indicating the name of the variable in

FtTimes 
a list with components numeric vectors denoting the time points
for which we wish to compute subjectspecific predictions after the last
available measurement provided in 
M 
numeric scalar denoting the number of Monte Carlo samples. See Details. 
returnData 
logical; if 
scale 
a numeric value setting the scaling of the covariance matrix of the empirical Bayes estimates in the Metropolis step during the Monte Carlo sampling. 
... 
additional arguments; currently none is used. 
When type = "Marginal"
, this function computes predicted values for the
fixedeffects part of the longitudinal submodel. In particular,
let X denote the fixedeffects design matrix calculated using
newdata
. The predict()
calculates \hat{y} = X \hat{β},
and if interval = "confidence"
, var(\hat{y}) = X V X^t, with V
denoting the covariance matrix of \hat{β}. Confidence intervals are constructed under
the normal approximation.
When type = "Subject"
, this functions computes subjectspecific
predictions for the longitudinal outcome based on the joint model.
This accomplished with a Monte Carlo simulation scheme, similar to the one
described in survfitJM
. The only difference is in Step 3, where
for interval = "confidence"
y_i^* = X_i β^* + Z_i b_i^*, whereas
for interval = "prediction"
y_i^* is a random vector from a normal
distribution with mean X_i β^* + Z_i b_i^* and standard deviation
σ^*. Based on this Monte Carlo simulation scheme we take as
estimate of \hat{y}_i the average of the M
estimates y_i^*
from each Monte Carlo sample. Confidence intervals are constructed using the
percentiles of y_i^* from the Monte Carlo samples.
If se.fit = FALSE
a numeric vector of predicted values, otherwise a
list with components pred
the predicted values, se.fit
the
standard error for the fitted values, and low
and upp
the lower
and upper limits of the confidence interval. If returnData = TRUE
, it
returns the data frame newdata
with the previously mentioned components
added.
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
Rizopoulos, D. (2012) Joint Models for Longitudinal and TimetoEvent Data: with Applications in R. Boca Raton: Chapman and Hall/CRC.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  ## Not run:
# linear mixed model fit
fitLME < lme(log(serBilir) ~ drug * year,
random = ~ year  id, data = pbc2)
# survival regression fit
fitSURV < survreg(Surv(years, status2) ~ drug,
data = pbc2.id, x = TRUE)
# joint model fit, under the (default) Weibull model
fitJOINT < jointModel(fitLME, fitSURV, timeVar = "year")
DF < with(pbc2, expand.grid(drug = levels(drug),
year = seq(min(year), max(year), len = 100)))
Ps < predict(fitJOINT, DF, interval = "confidence", return = TRUE)
require(lattice)
xyplot(pred + low + upp ~ year  drug, data = Ps,
type = "l", col = c(2,1,1), lty = c(1,2,2), lwd = 2,
ylab = "Average log serum Bilirubin")
# Subjectspecific predictions
ND < pbc2[pbc2$id == 2, ]
Ps.ss < predict(fitJOINT, ND, type = "Subject",
interval = "confidence", return = TRUE)
require(lattice)
xyplot(pred + low + upp ~ year  id, data = Ps.ss,
type = "l", col = c(2,1,1), lty = c(1,2,2), lwd = 2,
ylab = "Average log serum Bilirubin")
## End(Not run)

Loading required package: MASS
Loading required package: nlme
Loading required package: splines
Loading required package: survival
Loading required package: lattice
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.