Re: [R] extract variance for random effects from "mer" object

From: Ben Bolker <bbolker_at_gmail.com>
Date: Thu, 07 Apr 2011 11:29:59 +0000

Maas James Dr (MED <J.Maas <at> uea.ac.uk> writes:

> I get an output from a glmer package, but would like
> to extract the variance of the Random effects, in this
> case called trtpair and the value is 0.
[snip]
> > fednmaout
> Generalized linear mixed model fit by the Laplace approximation
> Formula: cbind(fednmadat$events, fednmadat$patnums - fednmadat$events) ~
treat + tn + (1 | trtpair)
> AIC BIC logLik deviance
> 84.01 153.1 -9.006 18.01
> Random effects:
> Groups Name Variance Std.Dev.
> trtpair (Intercept) 0 0
> Number of obs: 60, groups: trtpair, 3
>

  VarCorr(fednmaout)[[1]]

(the [[1]] means to extract the variance for the first (and only in this case) random effect.)



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 07 Apr 2011 - 11:32:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 07 Apr 2011 - 11:40:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive