
Predict the masked (missing) response cells of a gllvmTMB fit
Source:R/methods-gllvmTMB.R
predict_missing.RdFor a model fitted with missing = miss_control(response = "include")
(see miss_control()), gllvmTMB() keeps the rows / cells whose response
was missing, masks them out of the likelihood, and predicts them from the
fitted model. predict_missing() returns those masked response cells with
their model-based predictions and the original-row / cell accounting from
fit$missing_data.
Usage
predict_missing(object, type = c("link", "response"), ...)Arguments
- object
A fit returned by
gllvmTMB().- type
One of
"link"(default; the linear predictor) or"response"(the inverse-link conditional mean).- ...
Unused.
Value
A data frame with one row per masked response cell, with columns:
original_row (the supplied long-data row or the supplied wide-data row
before traits() stacking),
model_row (the row index into the fitted long-format data / response),
the unit / cluster / trait identifier columns, and est (the prediction
on the requested scale). A complete-data fit (no masked cells) returns a
zero-row data frame with the same columns.
Details
Missing responses are predicted / reconstructed as fitted values,
not latent covariates. The separate imputed() extractor returns modelled
missing predictors from supported mi() fits.
The point predictions here are the fitted linear predictor (type = "link")
or its inverse-link response (type = "response"). Reconstruction standard
errors and prediction intervals are not currently returned.