[R] storing the estimates from lmer

Spencer Graves spencer.graves at pdf.com
Sat Jul 15 19:11:25 CEST 2006


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))
(fm1.fix.se <- sqrt(diag(vcov(fm1))))
fm1.fix/fm1.fix.se

fm1.ran <- VarCorr(fm1)
diag(fm1.ran$Subject)

########################
	  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]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list