predict.rlmerMod: Predictions and confidence/prediction intervals for an...

View source: R/fromLme4.R

predict.rlmerModR Documentation

Predictions and confidence/prediction intervals for an rlmerMod fit.

Description

By default (interval = "none") returns the same numeric vector as the lme4-style point prediction (preserved byte-for-byte from the pre-existing predict method). With interval = "confidence" or "prediction", returns a data frame with columns fit, lwr, upr, se.

Usage

## S3 method for class 'rlmerMod'
predict(
  object,
  newdata = NULL,
  re.form = NULL,
  ReForm,
  REForm,
  REform,
  terms = NULL,
  type = c("link", "response"),
  allow.new.levels = FALSE,
  na.action = na.pass,
  interval = c("none", "confidence", "prediction"),
  level = 0.95,
  ...
)

Arguments

object

An rlmerMod object.

newdata, re.form, ReForm, REForm, REform, terms, type, allow.new.levels, na.action, ...

See the lme4 predict.merMod documentation; these arguments are forwarded unchanged to the point-prediction code path.

interval

One of "none" (default, returns a numeric vector for backwards compatibility), "confidence" (fit-uncertainty interval for X\hat{\beta} + Z\hat{b}), or "prediction" (adds residual variance \hat{\sigma}^2).

level

Coverage level for the interval; default 0.95.

Details

The fixed-effect contribution to the SE uses the robust cluster sandwich vcov(object, type = "sandwich"); the random-effects contribution (when REs are part of the prediction) is computed from the partial influence function of \hat{u} (the local-shift sensitivity). For interval = "prediction" the additional residual variance \hat{\sigma}^2 is added. Intervals are fit +/- z * se with z = \Phi^{-1}((1 + level)/2); for small numbers of clusters the normal approximation may under-cover, and a bootstrap CI (via confint(..., method = "boot")) is preferable.

Value

A numeric vector (when interval = "none") or a data frame with columns fit, lwr, upr, se.

See Also

vcov


robustlmm documentation built on June 21, 2026, 5:12 p.m.