EB {brokenstick} | R Documentation |
Empirical Bayes predictor for random effects
Description
This function can estimate random effect for a given set of model estimates and new user data. The unit may be new to the model. The methods implements the EB estimate (also known as BLUP) as described in Skrondral and Rabe-Hasketh, 2009, p. 683. This function can also provide the broken stick estimate for a given level, the sum of the global (fixed) and individual (random) effects. The current implementation does not provide prediction errors.
Usage
EB(model, y, X, Z = X, BS = TRUE)
Arguments
model |
An object of class |
y |
A vector of new measurements for unit j, scaled in the same metric as the fitted model. |
X |
A |
Z |
A |
BS |
A logical indicating whether broken stick estimates should be
returned ( |
Value
A vector of length q containing the random effect or broken stick estimates for unit j.
Author(s)
Stef van Buuren 2023
References
Skrondal, A., Rabe-Hesketh, S. (2009). Prediction in multilevel generalized linear models. J. R. Statist. Soc. A, 172, 3, 659-687.