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]]
You need the VarCorr function. I think you mean that lmer is in the Matrix package.> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of prabhu bhaga > Sent: Tuesday, July 11, 2006 11:19 AM > To: r-help at stat.math.ethz.ch > Subject: [R] storing the estimates from lmer > > 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 >
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
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