[R-sig-ME] Extract information from lmer summary table

Andrzej Galecki agalecki at umich.edu
Mon Feb 14 02:07:19 CET 2011


Hi Sam,

I agree with Ista's suggestion.  Alternatively (and probably this is 
what you had in mind),  you can access components (slots) of  mer-object 
in a following way:

library(lme4)

## From a fitted model
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
class(fm1)                #  mer
slotNames("mer")   #   34 slot names
slot(fm1, "fixef")      #    fixef(fm1) also works
fm1 at fixef

### Similarly from a summary
summ <- summary(fm1)
class(summ)          # summary.mer
slotNames("summary.mer")   # 42 slot names
slot(summ, "coefs")                 # coefs(summ) also works
summ at coefs

Thank you

Andrzej Galecki



On 2/4/2011 12:13 PM, Ista Zahn wrote:
> Hi Sam,
> Try this:
>
> library(hints) # may need install.packages("hints") first
> fm1<- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
> hints(fm1)
>
> This might lead you to something like
>
>
> fm1<- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
> hints(fm1)
>
> fm1.results<- list(ran=ranef(fm1), fix=fixef(fm1), vc=VarCorr(fm1))
>
> Also see
> ?"mer-class" for a complete list of methods for mer objects.
>
> Best,
> Ista
>
> ?"mer-class"
>
>
> On Fri, Feb 4, 2011 at 11:02 AM, Sam Cartwright
> <S.J.Cartwright at pgr.reading.ac.uk>  wrote:
>> Hello,
>>
>> I'm trying to extract components of the summary table from a lmer model.  However, I can't seem to access the summary as I would be able to with a linear model summary table (using either $ operator or square brackets).  As an 'mer' object, is there any method to enable the extraction of information from the lmer model summary table?  I can't seem to find any info on how to do this but would have thought it would be a common problem?
>>
>> Many thanks,
>>
>> Sam
>>
>>
>>
>> Centre for Agri-Environment Research (CAER)
>> Department of Agriculture, Policy and Development
>> University of Reading
>> PO Box 237, Earley Gate
>> Reading RG6 6AR
>> UK
>>
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>
>




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