Re: [R] storing the estimates from lmer

From: Spencer Graves <>
Date: Sun 16 Jul 2006 - 03:11:25 EST

p.s. I intended to include the following extension to an example from the 'lmer' help page:

fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy) (fm1.fix <- fixef(fm1))
( <- sqrt(diag(vcov(fm1))))

fm1.ran <- VarCorr(fm1)

	  The structure of 'lmer' objects and helper functions is outlined in
the 'lmer' and 'lmer-class' help pages. The latter mentions "'vcov 'signature(object = "mer")': Calculate variance-covariance matrix of the _fixed_ effect terms, see also 'vcov'." Thus, sqrt(diag(vcov(lmer.object))) should give you standard errors of the fixed effects.

          The parameter estimates can be obtained using 'VarCorr'. However, characterizing their random variability is harder, because their distribution is not as simply summarized. The 'lmer-class' help page says that an 'lmer' object includes a slot, "'Omega': A list of positive-definite matrices stored as '"dpoMatrix"' objects that are the relative precision matrices of the random effects associated with each of the grouping factors." However, I don't know how to use this. For problems like this, the 'lme4' and 'Matrix' packages include a function 'simulate', which is what I might use, at least until I figured out how to get essentially the same answer from the Omega slot.

	  Hope this helps,
	  Spencer Graves

prabhu bhaga wrote:
> Dear all,
> I'm trying to store/extract the mean& standard error of the fixed effects
> parameter and the variance of the random effects parameter from "lmer"
> procedure from mlmre4 package developed by bates n pinheiro. while storing
> fixed effects parameter is straight forward, the same is not true for
> storing the variance parameter of the random effects. kindly help me
> ~prabhu
> [[alternative HTML version deleted]]
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Sun Jul 16 03:17:40 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 16 Jul 2006 - 06:14:46 EST.

Mailing list information is available at Please read the posting guide before posting to the list.