[R-sig-ME] bug in confint with boot method and several random terms ?

espesser robert.espesser at lpl-aix.fr
Sun Jan 12 16:10:30 CET 2014


Dear all,

Here is a reproducible example of a possible bug concerning 
confint.merMod with method="boot",
when more than a single random term is specified.
The problem does not concern the bootstrapping itself, but the external 
function  bootFun.
Unhappily, I'm not skill enough to fix it.
I did not found previous mention of this , but apologizes if I'm missing 
something.

Thank you for your help

R. espesser



library(lme4)

data(Penicillin)

fm2 <- lmer(diameter ~ 1 + (1|plate) + (1|sample), Penicillin)
summary(fm2)
Linear mixed model fit by REML ['lmerMod']
Formula: diameter ~ 1 + (1 | plate) + (1 | sample)
    Data: Penicillin

REML criterion at convergence: 330.8606

Random effects:
  Groups   Name        Variance Std.Dev.
  plate    (Intercept) 0.7169   0.8467
  sample   (Intercept) 3.7309   1.9316
  Residual             0.3024   0.5499
Number of obs: 144, groups: plate, 24; sample, 6

Fixed effects:
             Estimate Std. Error t value
(Intercept)  22.9722     0.8086   28.41

  confint(fm2, method="boot",nsim=100)
Computing bootstrap confidence intervals ...
Error in setNames(Cv_to_Sv(th, s = sigma(x)), c(tnames(x, old = FALSE,  :
   'names' attribute [3] must be the same length as the vector [2]
In addition: Warning message:
In m0[lower.tri(m0, diag = TRUE)] <- x :
   number of items to replace is not a multiple of replacement length




# It is OK with only one random intercept:

  fm2_single <- lmer(diameter ~ 1 + (1|plate) , Penicillin)

  confint(fm2_single, method="boot",nsim=100)
Computing bootstrap confidence intervals ...
                          2.5 %     97.5 %
sd_(Intercept)|plate  0.000000  0.7437895
sigma                 1.751577  2.1949818
(Intercept)          22.606299 23.3667589


I
##########################
  sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252    
LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] boot_1.3-9      lme4_1.0-5      Matrix_1.1-0    lattice_0.20-23

loaded via a namespace (and not attached):
  [1] colorspace_1.2-4   dichromat_2.0-0    digest_0.6.4       
ggplot2_0.9.3.1    grid_3.0.2
  [6] gtable_0.1.2       labeling_0.2       MASS_7.3-29        
minqa_1.2.1        munsell_0.4.2
[11] nlme_3.1-111       plyr_1.8           proto_0.3-10       
RColorBrewer_1.0-5 reshape2_1.2.2
[16] scales_0.2.3       splines_3.0.2      stringr_0.6.2      tools_3.0.2
 >


-- 
Robert Espesser
CNRS UMR  7309 - Université Aix-Marseille
5 Avenue Pasteur
13100 AIX-EN-PROVENCE

Tel: +33 (0)413 55 36 26



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