## Documentation Center |

` ypred = predict(lme)` returns
a vector of conditional predicted
responses

` ypred = predict(lme,tblnew)` returns
a vector of conditional predicted responses

If a particular grouping variable in `tblnew` has
levels that are not in the original data, then the random effects
for that grouping variable do not contribute to the `'Conditional'` prediction
at observations where the grouping variable has new levels.

` ypred = predict(lme,Xnew,Znew)` returns
a vector of conditional predicted responses

Use the matrix format for `predict` if using
design matrices for fitting the model `lme`.

` ypred = predict(lme,Xnew,Znew,Gnew)` returns
a vector of conditional predicted responses

`Znew` and `Gnew` can also
be cell arrays of matrices and grouping variables, respectively.

` ypred = predict(___,Name,Value)` returns
a vector of predicted responses

For example, you can specify the confidence level, simultaneous confidence bounds, or contributions from only fixed effects.

A conditional prediction includes contributions from both fixed and random effects, whereas a marginal model includes contribution from only fixed effects.

Suppose the linear mixed-effects model `lme` has
an *n*-by-*p* fixed-effects design
matrix `X` and an *n*-by-*q* random-effects
design matrix `Z`. Also, suppose the estimated *p*-by-1
fixed-effects vector is
,
and the *q*-by-1 estimated best linear unbiased predictor
(BLUP) vector of random effects is
.
The predicted conditional response is

which corresponds to the `'Conditional','true'` and `'Prediction','curve'` name-value
pair arguments. The predicted conditional response that also includes
observation error is

which corresponds to the `'Conditional','true'` and `'Prediction','observation'` name-value
pair arguments.

The predicted marginal response is

This corresponds to the `'Conditional','false'` and `'Prediction','curve'` name-value
pair arguments. The marginal conditional response that also includes
observation error is

which corresponds to the `'Conditional','false'` and `'Prediction','observation'` name-value
pair arguments.

When making predictions, if a particular grouping variable has
new levels (1s that were not in the original data), then the random
effects for the grouping variable do not contribute to the `'Conditional'` prediction
at observations where the grouping variable has new levels.

Was this topic helpful?