Skip to contents

Returns the linear predictor or inverse-link response at each observation in the training data, or at user-supplied newdata. For mixed-family fits, type = "response" uses the row's own trait/family inverse link rather than the first trait's link.

Usage

# S3 method for class 'gllvmTMB_multi'
predict(
  object,
  newdata = NULL,
  type = c("link", "response"),
  re_form = ~.,
  ...
)

Arguments

object

A fit returned by gllvmTMB().

newdata

Optional new data frame. If NULL, predictions are produced for the training rows.

type

One of "link" (default) or "response".

re_form

Random-effect formula controlling which random effects are included in the predicted linear predictor. Use the default ~ . to include all random effects when predicting on training rows; pass ~ 0 (or NA) to predict the fixed- effects-only / population-mean prediction. For newdata with sites/species not present in the training data the random effects cannot be drawn, so the prediction is fixed-effects-only regardless of re_form.

...

Unused.

Value

A data frame with the original row identifiers plus an est column on the requested link or response scale.