pglmm_predicted_values calculates the predicted values of Y; for the generalized linear mixed model (family %in% c("binomial","poisson"), these values are in the transformed space.

pglmm_predicted_values(
  x,
  cpp = TRUE,
  gaussian.pred = c("nearest_node", "tip_rm"),
  re.form = NULL,
  type = c("link", "response"),
  ...
)

communityPGLMM.predicted.values(
  x,
  cpp = TRUE,
  gaussian.pred = c("nearest_node", "tip_rm")
)

Arguments

x

A fitted model with class communityPGLMM.

cpp

Whether to use c++ code. Default is TRUE.

gaussian.pred

When family is gaussian, which type of prediction to calculate? Option nearest_node will predict values to the nearest node, which is same as lme4::predict or fitted. Option tip_rm will remove the point then predict the value of this point with remaining ones.

re.form

(formula, NULL, or NA) specify which random effects to condition on when predicting. If NULL, include all random effects (i.e Xb + Zu); if NA or ~0, include no random effects (i.e. Xb).

type

character string - either "link", the default, or "response" indicating the type of prediction object returned.

...

Optional additional parameters. None are used at present.

Value

A data frame with column Y_hat (predicted values accounting for both fixed and random terms).