[Lme4-commits] r1865 - pkg/mlmRev/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 23 21:06:08 CEST 2013


Author: walker
Date: 2013-09-23 21:06:08 +0200 (Mon, 23 Sep 2013)
New Revision: 1865

Removed:
   pkg/mlmRev/tests/guImmun.Rout.save
   pkg/mlmRev/tests/lmerTest.Rout.save
Log:
removed Rout.save files to comply with CRAN

Deleted: pkg/mlmRev/tests/guImmun.Rout.save
===================================================================
--- pkg/mlmRev/tests/guImmun.Rout.save	2013-09-23 14:42:09 UTC (rev 1864)
+++ pkg/mlmRev/tests/guImmun.Rout.save	2013-09-23 19:06:08 UTC (rev 1865)
@@ -1,187 +0,0 @@
-
-R version 3.0.1 (2013-05-16) -- "Good Sport"
-Copyright (C) 2013 The R Foundation for Statistical Computing
-Platform: x86_64-apple-darwin10.8.0 (64-bit)
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> library(mlmRev)
-Loading required package: lme4
-Loading required package: lattice
-Loading required package: Matrix
-> options(digits=6, useFancyQuotes = FALSE)# signif.stars for once..
-> 
-> fm <- glmer(immun ~ kid2p + mom25p + ord + ethn + momEd +
-+             husEd + momWork + rural + pcInd81 + (1|mom) + (1|comm),
-+             data = guImmun, family = binomial)
-Warning message:
-In (function (fn, par, lower = rep.int(-Inf, n), upper = rep.int(Inf,  :
-  failure to converge in 10000 evaluations
-> print(fm, symbolic.cor = TRUE)
-Generalized linear mixed model fit by maximum likelihood ['glmerMod']
- Family: binomial ( logit )
-Formula: immun ~ kid2p + mom25p + ord + ethn + momEd + husEd + momWork +      rural + pcInd81 + (1 | mom) + (1 | comm) 
-   Data: guImmun 
-     AIC      BIC   logLik deviance 
- 2747.48  2849.67 -1355.74  2711.48 
-Random effects:
- Groups Name        Std.Dev.
- mom    (Intercept) 1.148   
- comm   (Intercept) 0.727   
-Number of obs: 2159, groups: mom, 1595; comm, 161
-Fixed Effects:
-(Intercept)       kid2pY      mom25pY        ord23        ord46        ord7p  
-  -0.879711     1.268196    -0.125451    -0.158003     0.155659     0.265419  
-      ethnN        ethnS       momEdP       momEdS       husEdP       husEdS  
-  -0.147083    -0.050289     0.276992     0.277592     0.386208     0.346964  
-     husEdU     momWorkY       ruralY      pcInd81  
-  -0.000177     0.264580    -0.663442    -0.865817  
-> 
-> fm.h <- update(fm, ~ . - husEd)
-> print(fm.h, corr = FALSE)
-Generalized linear mixed model fit by maximum likelihood ['glmerMod']
- Family: binomial ( logit )
-Formula: immun ~ kid2p + mom25p + ord + ethn + momEd + momWork + rural +      pcInd81 + (1 | mom) + (1 | comm) 
-   Data: guImmun 
-     AIC      BIC   logLik deviance 
- 2748.60  2833.76 -1359.30  2718.60 
-Random effects:
- Groups Name        Std.Dev.
- mom    (Intercept) 1.119   
- comm   (Intercept) 0.723   
-Number of obs: 2159, groups: mom, 1595; comm, 161
-Fixed Effects:
-(Intercept)       kid2pY      mom25pY        ord23        ord46        ord7p  
-     -0.609        1.261       -0.147       -0.149        0.151        0.230  
-      ethnN        ethnS       momEdP       momEdS     momWorkY       ruralY  
-     -0.247       -0.101        0.337        0.352        0.267       -0.715  
-    pcInd81  
-     -0.824  
-> fm.ho <- update(fm.h, ~ . - ord)
-> ## FIXME: shows 53 outer iterations (+ probably IRLS ones) --
-> ##        but no such info is kept stored
-> print(fm.ho, corr = FALSE)
-Generalized linear mixed model fit by maximum likelihood ['glmerMod']
- Family: binomial ( logit )
-Formula: immun ~ kid2p + mom25p + ethn + momEd + momWork + rural + pcInd81 +      (1 | mom) + (1 | comm) 
-   Data: guImmun 
-     AIC      BIC   logLik deviance 
- 2746.30  2814.43 -1361.15  2722.30 
-Random effects:
- Groups Name        Std.Dev.
- mom    (Intercept) 1.111   
- comm   (Intercept) 0.711   
-Number of obs: 2159, groups: mom, 1595; comm, 161
-Fixed Effects:
-(Intercept)       kid2pY      mom25pY        ethnN        ethnS       momEdP  
-    -0.6809       1.2645       0.0262      -0.2113      -0.0792       0.3306  
-     momEdS     momWorkY       ruralY      pcInd81  
-     0.3229       0.2487      -0.6804      -0.8417  
-> 
-> anova(fm, fm.h, fm.ho)
-Data: guImmun
-Models:
-fm.ho: immun ~ kid2p + mom25p + ethn + momEd + momWork + rural + pcInd81 + 
-fm.ho:     (1 | mom) + (1 | comm)
-fm.h: immun ~ kid2p + mom25p + ord + ethn + momEd + momWork + rural + 
-fm.h:     pcInd81 + (1 | mom) + (1 | comm)
-fm: immun ~ kid2p + mom25p + ord + ethn + momEd + husEd + momWork + 
-fm:     rural + pcInd81 + (1 | mom) + (1 | comm)
-      Df  AIC  BIC logLik deviance Chisq Chi Df Pr(>Chisq)  
-fm.ho 12 2746 2814  -1361     2722                          
-fm.h  15 2749 2834  -1359     2719 3.701      3     0.2956  
-fm    18 2748 2850  -1356     2712 7.118      3     0.0682 .
----
-Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-> 
-> (fm.hoe <- update(fm.ho, ~ . - ethn))
-Generalized linear mixed model fit by maximum likelihood ['glmerMod']
- Family: binomial ( logit )
-Formula: immun ~ kid2p + mom25p + momEd + momWork + rural + pcInd81 +      (1 | mom) + (1 | comm) 
-   Data: guImmun 
-     AIC      BIC   logLik deviance 
- 2742.77  2799.54 -1361.38  2722.77 
-Random effects:
- Groups Name        Std.Dev.
- mom    (Intercept) 1.093   
- comm   (Intercept) 0.698   
-Number of obs: 2159, groups: mom, 1595; comm, 161
-Fixed Effects:
-(Intercept)       kid2pY      mom25pY       momEdP       momEdS     momWorkY  
-    -0.7017       1.2660       0.0252       0.3530       0.3604       0.2588  
-     ruralY      pcInd81  
-    -0.6708      -0.9535  
-> 
-> (fm.hoem <- update(fm.hoe, ~ . - mom25p))
-Generalized linear mixed model fit by maximum likelihood ['glmerMod']
- Family: binomial ( logit )
-Formula: immun ~ kid2p + momEd + momWork + rural + pcInd81 + (1 | mom) +      (1 | comm) 
-   Data: guImmun 
-     AIC      BIC   logLik deviance 
-  2740.8   2791.9  -1361.4   2722.8 
-Random effects:
- Groups Name        Std.Dev.
- mom    (Intercept) 1.114   
- comm   (Intercept) 0.699   
-Number of obs: 2159, groups: mom, 1595; comm, 161
-Fixed Effects:
-(Intercept)       kid2pY       momEdP       momEdS     momWorkY       ruralY  
-     -0.698        1.258        0.358        0.353        0.278       -0.672  
-    pcInd81  
-     -0.945  
-> 
-> (AN <- anova(fm, fm.h, fm.ho, fm.hoe, fm.hoem))
-Data: guImmun
-Models:
-fm.hoem: immun ~ kid2p + momEd + momWork + rural + pcInd81 + (1 | mom) + 
-fm.hoem:     (1 | comm)
-fm.hoe: immun ~ kid2p + mom25p + momEd + momWork + rural + pcInd81 + 
-fm.hoe:     (1 | mom) + (1 | comm)
-fm.ho: immun ~ kid2p + mom25p + ethn + momEd + momWork + rural + pcInd81 + 
-fm.ho:     (1 | mom) + (1 | comm)
-fm.h: immun ~ kid2p + mom25p + ord + ethn + momEd + momWork + rural + 
-fm.h:     pcInd81 + (1 | mom) + (1 | comm)
-fm: immun ~ kid2p + mom25p + ord + ethn + momEd + husEd + momWork + 
-fm:     rural + pcInd81 + (1 | mom) + (1 | comm)
-        Df  AIC  BIC logLik deviance Chisq Chi Df Pr(>Chisq)  
-fm.hoem  9 2741 2792  -1361     2723                          
-fm.hoe  10 2743 2800  -1361     2723 0.030      1     0.8622  
-fm.ho   12 2746 2814  -1361     2722 0.471      2     0.7903  
-fm.h    15 2749 2834  -1359     2719 3.701      3     0.2956  
-fm      18 2748 2850  -1356     2712 7.118      3     0.0682 .
----
-Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-> 
-> AN[, "logLik"] + 1362                   # an inversion in the first two models
-[1] 0.600013 0.615079 0.850417 2.701099 6.260151
-> ## FIXME: AN doesn't have a deviance column!
-> ## AN[, "deviance"] - 2711                 # deviance scale shows this more clearly
-> stopifnot(AN[,"Df"] == c(9,10,12,15,18),
-+ #          all.equal(AN[,"logLik"] + 1362,
-+ #                    c(0.6072186497422, 0.6289103306312, 0.8541186984307,
-+ #                      2.725550814599, 6.299084917162), tol = 1e-6),
-+ #          all.equal(fixef(fm.hoem)[-1],
-+ #                    c("kid2pY" = 1.2662536,  "momEdP"= 0.35116180,
-+ #                      "momEdS"= 0.3487824136, "momWorkY"=0.2672759992340,
-+ #                      "ruralY"=-0.678846606719, "pcInd81"=-0.9612710104134),
-+ #                    tol = 1e-4),
-+           TRUE
-+           )
-> 
-> 
-> cat('Time elapsed: ', proc.time(),'\n') # "stats"
-Time elapsed:  110.759 0.204 110.957 0.001 0.002 
-> 
-> proc.time()
-   user  system elapsed 
-110.760   0.206 110.957 

Deleted: pkg/mlmRev/tests/lmerTest.Rout.save
===================================================================
--- pkg/mlmRev/tests/lmerTest.Rout.save	2013-09-23 14:42:09 UTC (rev 1864)
+++ pkg/mlmRev/tests/lmerTest.Rout.save	2013-09-23 19:06:08 UTC (rev 1865)
@@ -1,482 +0,0 @@
-
-R version 2.10.0 RC (2009-10-25 r50206)
-Copyright (C) 2009 The R Foundation for Statistical Computing
-ISBN 3-900051-07-0
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> ####  LMER: Put all the small data set tests into one file
-> library(mlmRev)
-Loading required package: lme4
-Loading required package: Matrix
-Loading required package: lattice
-
-> options(digits=6, show.signif.stars = FALSE)
-> 
-> ## bdf ---------------- Data ---------------------
-> (fm01 <- lmer(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen +         (1|schoolNR), bdf))
-Linear mixed model fit by REML 
-Formula: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (1 | schoolNR) 
-   Data: bdf 
-   AIC   BIC logLik deviance REMLdev
- 15242 15271  -7616    15228   15232
-Random effects:
- Groups   Name        Variance Std.Dev.
- schoolNR (Intercept)  7.886   2.808   
- Residual             42.172   6.494   
-Number of obs: 2287, groups: schoolNR, 131
-
-Fixed effects:
-               Estimate Std. Error t value
-(Intercept)     40.7410     0.2866   142.2
-IQ.ver.cen       2.4148     0.0717    33.7
-avg.IQ.ver.cen   1.5892     0.3148     5.0
-
-Correlation of Fixed Effects:
-            (Intr) IQ.vr.
-IQ.ver.cen   0.000       
-avg.IQ.vr.c  0.077 -0.228
-> (fm02 <- lmer(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen +(IQ.ver.cen|schoolNR), bdf))
-Linear mixed model fit by REML 
-Formula: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (IQ.ver.cen | schoolNR) 
-   Data: bdf 
-   AIC   BIC logLik deviance REMLdev
- 15232 15272  -7609    15214   15218
-Random effects:
- Groups   Name        Variance Std.Dev. Corr   
- schoolNR (Intercept)  8.076   2.8418          
-          IQ.ver.cen   0.208   0.4561   -0.642 
- Residual             41.350   6.4304          
-Number of obs: 2287, groups: schoolNR, 131
-
-Fixed effects:
-               Estimate Std. Error t value
-(Intercept)     40.7496     0.2881   141.5
-IQ.ver.cen       2.4598     0.0836    29.4
-avg.IQ.ver.cen   1.4089     0.3237     4.4
-
-Correlation of Fixed Effects:
-            (Intr) IQ.vr.
-IQ.ver.cen  -0.274       
-avg.IQ.vr.c  0.029 -0.213
-> ##
-> anova(fm01, fm02)
-Data: bdf
-Models:
-fm01: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (1 | schoolNR)
-fm02: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (IQ.ver.cen | schoolNR)
-     Df   AIC   BIC logLik Chisq Chi Df Pr(>Chisq)
-fm01  5 15238 15266  -7614                        
-fm02  7 15228 15268  -7607 14.01      2   0.000908
-> cat('Time elapsed: ', (.pt <- proc.time()),'\n') # "stats"
-Time elapsed:  7.259 0.141 7.552 0 0 
-> 
-> ## egsingle ----------- Data ---------------------
-> (fm1 <- lmer(math ~ year +    (1|childid) +    (1|schoolid), egsingle))
-Linear mixed model fit by REML 
-Formula: math ~ year + (1 | childid) + (1 | schoolid) 
-   Data: egsingle 
-   AIC   BIC logLik deviance REMLdev
- 16769 16804  -8380    16747   16759
-Random effects:
- Groups   Name        Variance Std.Dev.
- childid  (Intercept) 0.6699   0.8185  
- schoolid (Intercept) 0.1869   0.4323  
- Residual             0.3470   0.5891  
-Number of obs: 7230, groups: childid, 1721; schoolid, 60
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)  -0.7805     0.0611   -12.8
-year          0.7461     0.0054   138.3
-
-Correlation of Fixed Effects:
-     (Intr)
-year -0.031
-> (fm2 <- lmer(math ~ year +    (1|childid) + (year|schoolid), egsingle))
-Linear mixed model fit by REML 
-Formula: math ~ year + (1 | childid) + (year | schoolid) 
-   Data: egsingle 
-   AIC   BIC logLik deviance REMLdev
- 16496 16545  -8241    16472   16482
-Random effects:
- Groups   Name        Variance Std.Dev. Corr  
- childid  (Intercept) 0.67230  0.8199         
- schoolid (Intercept) 0.16683  0.4084         
-          year        0.01158  0.1076   0.443 
- Residual             0.32452  0.5697         
-Number of obs: 7230, groups: childid, 1721; schoolid, 60
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)  -0.7771     0.0582   -13.3
-year          0.7630     0.0153    49.8
-
-Correlation of Fixed Effects:
-     (Intr)
-year 0.358 
-> (fm3 <- lmer(math ~ year + (year|childid) +    (1|schoolid), egsingle))
-Linear mixed model fit by REML 
-Formula: math ~ year + (year | childid) + (1 | schoolid) 
-   Data: egsingle 
-   AIC   BIC logLik deviance REMLdev
- 16531 16580  -8259    16505   16517
-Random effects:
- Groups   Name        Variance Std.Dev. Corr  
- childid  (Intercept) 0.64811  0.8051         
-          year        0.02152  0.1467   0.463 
- schoolid (Intercept) 0.15369  0.3920         
- Residual             0.30120  0.5488         
-Number of obs: 7230, groups: childid, 1721; schoolid, 60
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept) -0.79307    0.05609   -14.1
-year         0.74716    0.00636   117.5
-
-Correlation of Fixed Effects:
-     (Intr)
-year 0.065 
-> (fm4 <- lmer(math ~ year + (year|childid) + (year|schoolid), egsingle))
-Linear mixed model fit by REML 
-Formula: math ~ year + (year | childid) + (year | schoolid) 
-   Data: egsingle 
-   AIC   BIC logLik deviance REMLdev
- 16355 16417  -8168    16326   16337
-Random effects:
- Groups   Name        Variance Std.Dev. Corr  
- childid  (Intercept) 0.64047  0.8003         
-          year        0.01126  0.1061   0.551 
- schoolid (Intercept) 0.16856  0.4106         
-          year        0.01126  0.1061   0.398 
- Residual             0.30143  0.5490         
-Number of obs: 7230, groups: childid, 1721; schoolid, 60
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)  -0.7792     0.0583   -13.4
-year          0.7631     0.0154    49.6
-
-Correlation of Fixed Effects:
-     (Intr)
-year 0.356 
-> ##
-> anova(fm1, fm2, fm3, fm4)
-Data: egsingle
-Models:
-fm1: math ~ year + (1 | childid) + (1 | schoolid)
-fm2: math ~ year + (1 | childid) + (year | schoolid)
-fm3: math ~ year + (year | childid) + (1 | schoolid)
-fm4: math ~ year + (year | childid) + (year | schoolid)
-    Df   AIC   BIC logLik Chisq Chi Df Pr(>Chisq)
-fm1  5 16757 16791  -8374                        
-fm2  7 16486 16534  -8236 275.2      2     <2e-16
-fm3  7 16519 16567  -8253   0.0      0     <2e-16
-fm4  9 16344 16406  -8163 179.0      2     <2e-16
-> cat('Time elapsed: ', {.ot <- .pt; (.pt <- proc.time()) - .ot},'\n') # "stats"
-Time elapsed:  7.913 0.039 7.954 0 0 
-> 
-> ## Early -------------- Data ---------------------
-> Early$tos <- Early$age - 0.5
-> (fm1E <- lmer(cog ~ tos * trt + (tos|id), Early))
-Linear mixed model fit by REML 
-Formula: cog ~ tos * trt + (tos | id) 
-   Data: Early 
-  AIC  BIC logLik deviance REMLdev
- 2375 2405  -1179     2370    2359
-Random effects:
- Groups   Name        Variance Std.Dev. Corr   
- id       (Intercept) 165.51   12.865          
-          tos          10.32    3.213   -1.000 
- Residual              75.49    8.689          
-Number of obs: 309, groups: id, 103
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)   118.41       2.76    43.0
-tos           -21.13       1.89   -11.2
-trtY            4.22       3.67     1.1
-tos:trtY        5.27       2.52     2.1
-
-Correlation of Fixed Effects:
-         (Intr) tos    trtY  
-tos      -0.819              
-trtY     -0.750  0.615       
-tos:trtY  0.615 -0.750 -0.819
-> 
-> ## Exam --------------- Data ---------------------
-> (fm05 <- lmer(normexam ~ standLRT + sex + schgend + (1|school), Exam))
-Linear mixed model fit by REML 
-Formula: normexam ~ standLRT + sex + schgend + (1 | school) 
-   Data: Exam 
-  AIC  BIC logLik deviance REMLdev
- 9362 9406  -4674     9326    9348
-Random effects:
- Groups   Name        Variance Std.Dev.
- school   (Intercept) 0.08583  0.2930  
- Residual             0.56253  0.7500  
-Number of obs: 4059, groups: school, 65
-
-Fixed effects:
-             Estimate Std. Error t value
-(Intercept)  -0.00105    0.05556     0.0
-standLRT      0.55976    0.01245    45.0
-sexM         -0.16739    0.03410    -4.9
-schgendboys   0.17769    0.11346     1.6
-schgendgirls  0.15900    0.08939     1.8
-
-Correlation of Fixed Effects:
-            (Intr) stnLRT sexM   schgndb
-standLRT    -0.014                      
-sexM        -0.316  0.061               
-schgendboys -0.395 -0.003 -0.145        
-schgendgrls -0.622  0.009  0.197  0.245 
-> 
-> ## Chem97 ------------- Data ---------------------
-> (fm06 <- lmer(score ~ gcsecnt + (1|school) + (1|lea), Chem97))
-Linear mixed model fit by REML 
-Formula: score ~ gcsecnt + (1 | school) + (1 | lea) 
-   Data: Chem97 
-    AIC    BIC logLik deviance REMLdev
- 141707 141749 -70848   141686  141697
-Random effects:
- Groups   Name        Variance Std.Dev.
- school   (Intercept) 1.16620  1.0799  
- lea      (Intercept) 0.01478  0.1216  
- Residual             5.15420  2.2703  
-Number of obs: 31022, groups: school, 2410; lea, 131
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)   5.6354     0.0312     180
-gcsecnt       2.4726     0.0169     146
-
-Correlation of Fixed Effects:
-        (Intr)
-gcsecnt 0.058 
-> 
-> cat('Time elapsed: ', {.ot <- .pt; (.pt <- proc.time()) - .ot},'\n') # "stats"
-Time elapsed:  2.508 0.051 2.559 0 0 
-> 
-> ## Hsb82 -------------- Data ---------------------
-> lmer(mAch ~ meanses*cses + sector*cses + (cses|school), Hsb82)
-Linear mixed model fit by REML 
-Formula: mAch ~ meanses * cses + sector * cses + (cses | school) 
-   Data: Hsb82 
-   AIC   BIC logLik deviance REMLdev
- 46524 46592 -23252    46496   46504
-Random effects:
- Groups   Name        Variance Std.Dev. Corr  
- school   (Intercept)  2.3796  1.5426         
-          cses         0.1012  0.3182   0.391 
- Residual             36.7212  6.0598         
-Number of obs: 7185, groups: school, 160
-
-Fixed effects:
-                    Estimate Std. Error t value
-(Intercept)           12.128      0.199    60.9
-meanses                5.333      0.369    14.4
-cses                   2.945      0.156    18.9
-sectorCatholic         1.227      0.306     4.0
-meanses:cses           1.039      0.299     3.5
-cses:sectorCatholic   -1.643      0.240    -6.9
-
-Correlation of Fixed Effects:
-            (Intr) meanss cses   sctrCt mnss:c
-meanses      0.256                            
-cses         0.075  0.019                     
-sectorCthlc -0.699 -0.356 -0.052              
-meanses:css  0.019  0.074  0.293 -0.026       
-css:sctrCth -0.052 -0.027 -0.696  0.077 -0.351
-> 
-> ## Oxford ------------- Data ---------------------
-> (fm07 <- lmer(height ~ age + I(age^2) + I(age^3) + I(age^4) +
-+               (age + I(age^2)|Subject),  data = Oxboys))
-Linear mixed model fit by REML 
-Formula: height ~ age + I(age^2) + I(age^3) + I(age^4) + (age + I(age^2) |      Subject) 
-   Data: Oxboys 
- AIC BIC logLik deviance REMLdev
- 652 693   -314      625     628
-Random effects:
- Groups   Name        Variance Std.Dev. Corr        
- Subject  (Intercept) 64.0345  8.0022               
-          age          2.8642  1.6924   0.614       
-          I(age^2)     0.6743  0.8212   0.215 0.658 
- Residual              0.2174  0.4662               
-Number of obs: 234, groups: Subject, 26
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)  149.019      1.570    94.9
-age            6.174      0.357    17.3
-I(age^2)       1.128      0.351     3.2
-I(age^3)       0.454      0.162     2.8
-I(age^4)      -0.377      0.300    -1.3
-
-Correlation of Fixed Effects:
-         (Intr) age    I(g^2) I(g^3)
-age       0.572                     
-I(age^2)  0.076  0.264              
-I(age^3) -0.001 -0.340  0.025       
-I(age^4)  0.021  0.016 -0.857 -0.021
-> (fm08 <- lmer(height ~ poly(age,4) +
-+               (age + I(age^2)|Subject),  data = Oxboys))
-Linear mixed model fit by REML 
-Formula: height ~ poly(age, 4) + (age + I(age^2) | Subject) 
-   Data: Oxboys 
- AIC BIC logLik deviance REMLdev
- 641 682   -308      625     617
-Random effects:
- Groups   Name        Variance Std.Dev. Corr        
- Subject  (Intercept) 64.0346  8.0022               
-          age          2.8642  1.6924   0.614       
-          I(age^2)     0.6743  0.8212   0.215 0.658 
- Residual              0.2174  0.4662               
-Number of obs: 234, groups: Subject, 26
-
-Fixed effects:
-              Estimate Std. Error t value
-(Intercept)    149.520      1.590    94.0
-poly(age, 4)1   64.541      3.328    19.4
-poly(age, 4)2    4.203      1.024     4.1
-poly(age, 4)3    1.291      0.466     2.8
-poly(age, 4)4   -0.585      0.466    -1.3
-
-Correlation of Fixed Effects:
-            (Intr) p(,4)1 p(,4)2 p(,4)3
-poly(ag,4)1 0.631                      
-poly(ag,4)2 0.230  0.583               
-poly(ag,4)3 0.000  0.000  0.000        
-poly(ag,4)4 0.000  0.000  0.000  0.000 
-> anova(fm07, fm08)
-Data: Oxboys
-Models:
-fm07: height ~ age + I(age^2) + I(age^3) + I(age^4) + (age + I(age^2) | 
-fm07:     Subject)
-fm08: height ~ poly(age, 4) + (age + I(age^2) | Subject)
-     Df   AIC   BIC logLik    Chisq Chi Df Pr(>Chisq)
-fm07 12 649.4 690.8 -312.7                           
-fm08 12 649.4 690.8 -312.7 1.68e-06      0     <2e-16
-> stopifnot(all.equal(logLik(fm07, REML=FALSE),
-+                     logLik(fm08, REML=FALSE)))
-> cat('Time elapsed: ', {.ot <- .pt; (.pt <- proc.time()) - .ot},'\n') # "stats"
-Time elapsed:  1.259 0 1.259 0 0 
-> 
-> ## ScotsSec ----------- Data ---------------------
-> cntr <- list()
-> (fmS1 <- lmer(attain ~ verbal * sex + (1|primary) + (1|second), ScotsSec,
-+              verbose = 1))
-  0:     14876.878: 0.338963 0.121450
-  1:     14869.350: 0.271130 0.0962183
-  2:     14869.120: 0.234540 0.0337758
-  3:     14868.448: 0.257104 0.0405381
-  4:     14868.361: 0.249359 0.0627845
-  5:     14868.329: 0.253832 0.0616944
-  6:     14868.328: 0.255792 0.0575285
-  7:     14868.326: 0.254891 0.0578338
-  8:     14868.325: 0.254282 0.0585648
-  9:     14868.325: 0.254614 0.0587516
- 10:     14868.325: 0.254463 0.0591014
- 11:     14868.325: 0.254509 0.0589167
- 12:     14868.325: 0.254490 0.0588844
-Linear mixed model fit by REML 
-Formula: attain ~ verbal * sex + (1 | primary) + (1 | second) 
-   Data: ScotsSec 
-   AIC   BIC logLik deviance REMLdev
- 14882 14925  -7434    14843   14868
-Random effects:
- Groups   Name        Variance Std.Dev.
- primary  (Intercept) 0.27545  0.5248  
- second   (Intercept) 0.01475  0.1214  
- Residual             4.25311  2.0623  
-Number of obs: 3435, groups: primary, 148; second, 19
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)  5.91473    0.07678    77.0
-verbal       0.15836    0.00379    41.8
-sexF         0.12155    0.07241     1.7
-verbal:sexF  0.00259    0.00539     0.5
-
-Correlation of Fixed Effects:
-            (Intr) verbal sexF  
-verbal       0.177              
-sexF        -0.482 -0.178       
-verbal:sexF -0.122 -0.680  0.161
-> #(fmS2 <- lmer(attain ~ verbal * sex + (1|primary) + (1|second), ScotsSec,
-> #             control = c(cntr, list(niterEM = 40))))
-> ## fmS1 and fmS2 should be essentially identical when optimizing with nlminb
-> ## The fits are substantially different when optimizing with optim
-> ##
-> (fmS3 <- lmer(attain ~ verbal + sex + (1|primary) +   (1|second), ScotsSec))
-Linear mixed model fit by REML 
-Formula: attain ~ verbal + sex + (1 | primary) + (1 | second) 
-   Data: ScotsSec 
-   AIC   BIC logLik deviance REMLdev
- 14872 14909  -7430    14843   14860
-Random effects:
- Groups   Name        Variance Std.Dev.
- primary  (Intercept) 0.27626  0.5256  
- second   (Intercept) 0.01449  0.1204  
- Residual             4.25195  2.0620  
-Number of obs: 3435, groups: primary, 148; second, 19
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)  5.91927    0.07615    77.7
-verbal       0.15959    0.00278    57.5
-sexF         0.11597    0.07146     1.6
-
-Correlation of Fixed Effects:
-       (Intr) verbal
-verbal  0.130       
-sexF   -0.473 -0.095
-> (fmS4 <- lmer(attain ~ verbal + sex + (1|primary) + (sex|second), ScotsSec))
-Linear mixed model fit by REML 
-Formula: attain ~ verbal + sex + (1 | primary) + (sex | second) 
-   Data: ScotsSec 
-   AIC   BIC logLik deviance REMLdev
- 14864 14913  -7424    14832   14848
-Random effects:
- Groups   Name        Variance Std.Dev. Corr   
- primary  (Intercept) 0.26860  0.5183          
- second   (Intercept) 0.04639  0.2154          
-          sexF        0.14583  0.3819   -0.798 
- Residual             4.21851  2.0539          
-Number of obs: 3435, groups: primary, 148; second, 19
-
-Fixed effects:
-            Estimate Std. Error t value
-(Intercept)  5.92741    0.08660    68.4
-verbal       0.15959    0.00277    57.6
-sexF         0.09844    0.11454     0.9
-
-Correlation of Fixed Effects:
-       (Intr) verbal
-verbal  0.115       
-sexF   -0.624 -0.060
-> ##
-> anova(fmS1, fmS3, fmS4)
-Data: ScotsSec
-Models:
-fmS3: attain ~ verbal + sex + (1 | primary) + (1 | second)
-fmS1: attain ~ verbal * sex + (1 | primary) + (1 | second)
-fmS4: attain ~ verbal + sex + (1 | primary) + (sex | second)
-     Df   AIC   BIC logLik Chisq Chi Df Pr(>Chisq)
-fmS3  6 14855 14892  -7421                        
-fmS1  7 14857 14900  -7421  0.23      1    0.63171
-fmS4  8 14848 14897  -7416 10.46      1    0.00122
-> 
-> cat('Time elapsed: ', {.ot <- .pt; (.pt <- proc.time()) - .ot},'\n') # "stats"
-Time elapsed:  1.241 0.005 1.247 0 0 
-> 



More information about the Lme4-commits mailing list