Description Usage Arguments Value Author(s) See Also Examples
Calculates subjectspecific predictions for new subjects from a linear mixed model.
1 2 3 4 5  IndvPred_lme(lmeObject, newdata, timeVar, times = NULL, M = 200L,
interval = c("confidence", "prediction"), all_times = FALSE,
level = 0.95, return_data = FALSE, seed = 1L)
extract_lmeComponents(lmeObject, timeVar)

lmeObject 
an object inheriting from class 
newdata 
a data frame in which to look for variables with which to predict. 
timeVar 
a character string specifying the time variable in the linear mixed model. 
interval 
a character string indicating what type of intervals should be computed. 
all_times 
logical; should predictions be calculated at all 
level 
a numeric scalar denoting the tolerance/confidence level. 
times 
a numeric vector denoting the time points for which we wish to compute the
subjectspecific predictions after the last available measurement provided in

M 
numeric scalar denoting the number of Monte Carlo samples. See Details. 
return_data 
logical; if 
seed 
numeric scalar, the random seed used to produce the results. 
If return_data = TRUE
, a the data frame newdata
with extra rows for the
time points at which predictions were calculated, and extra columns with the predictions
and the limits of the pointwise confidence intervals.
If return_data = FALSE
, a list with components
times_to_pred 
time points at which predictions were calculated. 
predicted_y 
the predictions. 
low 
the lower limits of the pointwise confidence intervals. 
upp 
the upper limits of the pointwise confidence intervals. 
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  ## Not run:
# linear mixed model fit
fitLME < lme(log(serBilir) ~ drug * ns(year, 2), data = subset(pbc2, id != 2),
random = ~ ns(year, 2)  id)
DF < IndvPred_lme(fitLME, newdata = subset(pbc2, id == 2), timeVar = "year",
M = 500, return_data = TRUE)
require(lattice)
xyplot(pred + low + upp ~ year  id, data = DF,
type = "l", col = c(2,1,1), lty = c(1,2,2), lwd = 2,
ylab = "Average log serum Bilirubin")
# extract_lmeComponents() extract the required components from the lme object
# that are required to calculate the predictions; this is a light weight version of
# the object, e.g.,
fitLME_light < extract_lmeComponents(fitLME, timeVar = "year")
DF < IndvPred_lme(fitLME_light, newdata = subset(pbc2, id == 2), timeVar = "year",
M = 500, return_data = TRUE)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.