Description Usage Arguments Details Value Examples
Predicted mean value conditional on covariates or on covariates and other outcome values.
1 2 3 4 5 6 7 8 9 10 11 12 
object 
a 
newdata 
[data.frame] the covariate values for each cluster. 
se 
[character] Type of uncertainty to be accounted for: estimation of the regression parameters ( 
df 
[logical] Should a Student's tdistribution be used to model the distribution of the predicted mean. Otherwise a normal distribution is used. 
type 
[character] Should prediction be made conditional on the covariates only ( 
level 
[numeric,01] the confidence level of the confidence intervals. 
keep.newdata 
[logical] Should the argument 
se.fit 
For internal use. When not missing mimic the output of 
... 
Not used. For compatibility with the generic method. 
Static prediction are made using the linear predictor Xβ while dynamic prediction uses the conditional normal distribution of the missing outcome given the observed outcomes. So if outcome 1 is observed but not 2, prediction for outcome 2 is obtain by X_2β + σ_{21}σ^{1}_{22}(Y_1X_1β). In that case, the uncertainty is computed as the sum of the conditional variance σ_{22}σ_{21}σ^{1}_{22}σ_{12} plus the uncertainty about the estimated conditional mean (obtained via delta method using numerical derivatives).
The model terms are computing by centering the design matrix around the mean value of the covariates used to fit the model. Then the centered design matrix is multiplied by the mean coefficients and columns assigned to the same variable (e.g. three level factor variable) are summed together.
A data.frame with 5 columns:
estimate
: predicted mean.
se
: uncertainty about the predicted mean.
df
: degree of freedom
lower
: lower bound of the confidence interval of the predicted mean
upper
: upper bound of the confidence interval of the predicted mean
except when the argument se.fit
is specified (see predict.lm
for the output format).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  ## simulate data in the long format
set.seed(10)
dL < sampleRem(100, n.times = 3, format = "long")
## fit Linear Mixed Model
eUN.lmm < lmm(Y ~ visit + X1 + X2 + X5,
repetition = ~visitid, structure = "UN", data = dL)
## prediction
newd < data.frame(X1 = 1, X2 = 2, X5 = 3, visit = factor(1:3, levels = 1:3))
predict(eUN.lmm, newdata = newd)
predict(eUN.lmm, newdata = newd, keep.newdata = TRUE)
## dynamic prediction
newd.d1 < cbind(newd, Y = c(NA,NA,NA))
predict(eUN.lmm, newdata = newd.d1, keep.newdata = TRUE, type = "dynamic")
newd.d2 < cbind(newd, Y = c(6.61,NA,NA))
predict(eUN.lmm, newdata = newd.d2, keep.newdata = TRUE, type = "dynamic")
newd.d3 < cbind(newd, Y = c(1,NA,NA))
predict(eUN.lmm, newdata = newd.d3, keep.newdata = TRUE, type = "dynamic")
newd.d4 < cbind(newd, Y = c(1,1,NA))
predict(eUN.lmm, newdata = newd.d4, keep.newdata = TRUE, type = "dynamic")

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