[R-sig-ME] Extracting Random Effects and Variances of Each Group from the Poisson Model

Ben Bolker bbolker at gmail.com
Wed Aug 28 00:34:37 CEST 2013


Hans Ekbrand <hans.ekbrand at ...> writes:

> 
> On Tue, Aug 27, 2013 at 05:02:06PM -0500, Lijun Chen wrote:
> > To get the predicted result for each county, I need to get the random
> > effect (residuals) for each county as well as their variances. However,
> > the ranef command only produce the random effect without giving the
> > confidence interval / variance. I would be glad if you can let me know
> > how to produce the confidence interval of these random effects so I can
> > calculate their confidence intervals. 
> > > ranef(fit2)
> 
> Have you tried
> 
> dotplot(ranef(fit2, postVar = TRUE))
> 
> and 
> 
> attr(ranef(fit2, postVar = TRUE)[[1]], "postVar")
> 
> ?
> 
  I would also suggest that you be very cautious in calling the
intervals generated from the conditional modes and their conditional
variances (i.e. the numbers you get from ranef(fit2, postVar=TRUE))
"confidence intervals".  They are certainly *some* kind of intervals,
but you can have a fine philosophical argument about what they mean ...

  Ben Bolker



More information about the R-sig-mixed-models mailing list