Re: [R] lmer print outs without T

From: Douglas Bates <bates_at_stat.wisc.edu>
Date: Thu 06 Jul 2006 - 06:44:13 EST

On 7/4/06, John Christie <jc@or.psychology.dal.ca> wrote:
> Hi,
> I have been having a tedious issue with lmer models with lots of
> factors and lots of levels. In order to get the basic information at
> the beginning of the print out I also have to generate these enormous
> tables as well. Is there a method command to leave off all of the
> effects and correlations? Or, do I have to go to string commands?

Depending on exactly which parts of the output you want it may be easiest to obtain them from the result of summary applied to your fitted model. Use str to determine the structure of the object then extract the slots that you want.

Warning: This is a somewhat risky practice in that we don't guarantee that the classes and slot names will remain constant. If there is an extractor function that gives the result that you want it is much safer to use that than to reach in to a structure and extract individual slots or components. However, in this case I don't think such an extractor exists.

As an example

> (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
Linear mixed-effects model fit by REML
Formula: Reaction ~ Days + (Days | Subject)

	  Data: sleepstudy
      AIC      BIC    logLik MLdeviance REMLdeviance
 1753.628 1769.593 -871.8141   1751.986     1743.628
Random effects:
 Groups   Name        Variance Std.Dev. Corr
 Subject  (Intercept) 612.090  24.7405
          Days         35.072   5.9221  0.066
 Residual             654.941  25.5918

number of obs: 180, groups: Subject, 18

Fixed effects:

            Estimate Std. Error t value
(Intercept) 251.4051     6.8246  36.838
Days         10.4673     1.5458   6.771

Correlation of Fixed Effects:
     (Intr)

Days -0.138
> so <- summary(fm1)
> showClass(class(so))

Slots:

Name:         isG  methTitle     logLik      ngrps      sigma      coefs
Class:    logical  character     logLik    integer    numeric     matrix

Name:        vcov      REmat     AICtab      flist         Zt          X
Class:  dpoMatrix     matrix data.frame       list  dgCMatrix     matrix

Name:           y        wts     wrkres     method   useScale     family
Class:    numeric    numeric    numeric  character    logical     family

Name:        call     cnames         nc         Gp        XtX        ZtZ
Class:       call       list    integer    integer  dpoMatrix  dsCMatrix

Name:         ZtX        Zty        Xty      Omega          L        RZX
Class:  dgeMatrix    numeric    numeric       list  dCHMsuper  dgeMatrix

Name:         RXX        rZy        rXy    devComp   deviance      fixef
Class: dtrMatrix numeric numeric numeric numeric numeric
Name:       ranef     RZXinv       bVar   gradComp     status     assign
Class:    numeric  dgeMatrix       list       list    logical    integer

Name:       frame      terms
Class: data.frame      terms

Extends:

Class "summary.mer", directly
Class "lmer", directly
Class "mer", by class "summary.mer"
Class "mer", by class "lmer"

> so@AICtab
AIC BIC logLik MLdeviance REMLdeviance 1753.628 1769.593 -871.8141 1751.986 1743.628
> print(so@REmat, quote = FALSE)
Groups Name Variance Std.Dev. Corr Subject (Intercept) 612.090 24.7405 Days 35.072 5.9221 0.066 Residual 654.941 25.5918 ______________________________________________
R-help@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 Received on Thu Jul 06 06:50:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 06 Jul 2006 - 08:18:02 EST.

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