predict.lmmelsm | R Documentation |

Generates posterior predictions from fitted LMMELSM object.

## S3 method for class 'lmmelsm' predict( object, newdata = NULL, prob = 0.95, summarize = TRUE, include_error = TRUE, ... )

`object` |
lmmelsm object. |

`newdata` |
Data.frame (Default: NULL). If NULL, uses original data.frame. |

`prob` |
Numeric (Default: .95). Amount of probability mass contained in the credible interval. |

`summarize` |
Logical (Default: TRUE). Whether to return posterior summaries (TRUE) or MCMC samples (FALSE). |

`include_error` |
Logical (Default: TRUE). If TRUE, then include stochastic realizations in outcome variables. |

`...` |
Not used. |

If the grouping variable is missing, or contains NAs, then new random effects are generated from the posterior random effect distribution. Where the grouping variables are not missing, the posterior standardized, orthogonalized random effects are obtained from the fitted model, and used as a basis for predicted random effects. Because the standardized, orthogonalized random effects are used, one can include different between-group variance values to predict new RE variances, and therefore a different random effect value. That is, the random effect, conditional on new between-group variance model covariates, is equal to:

*u_i = z_i U D_i*

, where *D_i* is the predicted between-group random effect SD, U is the upper cholesky factorization of the random effect correlations, and *z_i* is the standardized, orthogonalized random effect for group i.

List. If summarize is TRUE, then a list of outcome (eta, eta_logsd) and indicator (y) posterior predictive distribution summaries. If FALSE, an N-length list of lists of outcome and indicator MCMC samples.

Stephen Martin

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.