[R-sig-ME] Trying to align lmer output with Robinson's BLUP is a good thing
Ben Bolker
bbo|ker @end|ng |rom gm@||@com
Sun Apr 16 02:35:09 CEST 2023
You can get most of the answers to these questions from the JSS
paper (vignette("lmer", package = "lme4")).
X: getME(fitted_model, "X")
Z: t(getME(fitted_model, "Zt"))
I believe G is
Lambda <- t(getME(fitted_model, "Lambdat"))
G <- crossprod(Lambda) ## or maybe tcrossprod()?
R <- diag(nobs(fitted_model))
(but you should double/cross-check with the JSS vignette, I didn't
look at the definitions in the Robinson paper super-carefully)
At present lme4 only allows predictions that are either completely
unconditional (re.form = NA) or conditional on the b values (re.form =
NULL), not conditional on the y-values from the new level and the
top-level estimates (sigma^2, theta -> G). You can follow the machinery
in Robinson's paper or (as you pointed out in another e-mail) follow the
machinery here:
https://github.com/drizopoulos/JMbayes/blob/master/R/dynPred_lme.R but
adapted for lme4
This would be a good idea to include in lme4, if anyone wants to
implement and make a pull request :-)
On 2023-04-15 8:16 p.m., Ravi Varadhan via R-sig-mixed-models wrote:
> Hi,
>
> I am trying to understand the model fitting of lmer() with the aid of GK Robinson's 1991 paper "BLUP is a good thing." I am trying to align the lmer() output with Robinson's notation.
>
> I have a few questions in this regard.
>
> 1. How can I get matrices X and Z from lmer?
> 2. How do I obtain the variances G and R?
> 3. For a new subject (x*, z*), is it possible to obtain BLUP predictions of x*\beta + z*u as shown in Robinson's paper? When I try to do this using predict.merMod, it complains that new levels are not allowed for conditional prediction.
>
> Thank you,
> Ravi
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list