[R-sig-ME] Another bootMer bug? (after Ben Bolker's fix on Github, Aug 2, 9AM) [CORRECTION]
Steve Walker
steve.walker at utoronto.ca
Sat Aug 3 18:24:38 CEST 2013
I don't think this is a bug. I was able to run it just fine. Its just
that a fairly large proportion of the bootstrap samples failed to
converge. This is a common situation, as it is just a special case of
the general fact that not all glmer models are guaranteed to converge.
Cheers,
Steve
On 2013-08-03 11:52 AM, Michael Kubovy wrote:
> **********
> Reproducible example
> **********
> # Point your browser to: https://www.dropbox.com/s/27d780qorp2bbr3/data.txt , and download data.txt
> e1 <- read.table('data.txt', header = TRUE)
> e1$subNum <- factor(e1$subNum)
> e1$sesNum <-factor(e1$sesNum)
> e1$gamma.f <- factor(e1$gamma)
> e1$trial <- e1$trial + 1
> library(car)
> e1$response.f <- Recode(e1$response, " 0 = 'a'; 1 = 'b'; 2 = 'c'; else = 'd'", as.factor.result = TRUE)
> e1$duration <- Recode(e1$dT, " 6 = '100'; else = '300' ", as.factor.result = TRUE)
> names(e1)[10] <- 'bar'
> e1$cbr <- with(e1, c/b)
> e1ba <- e1[e1$response.f == 'a' | e1$response.f == 'b',]
> e1ba$response.f = factor(e1ba$response.f)
> e1ba$which <- factor('b')
> e1ba$aspectRatio <- e1ba$bar
> e1ba$aspectRatio.f <- factor(e1ba$aspectRatio)
> e1ba$aspectRatio.c <- e1ba$aspectRatio - median(e1ba$aspectRatio)
> library(lme4)
> e1ba.mer2 <- glmer(response.f ~ aspectRatio.c + (aspectRatio.c | subNum), family = binomial, data = e1ba)
> mySumm3 <- function(.) {
> c(beta=fixef(.))
> }
> boo01 <- bootMer(e1ba.mer2, FUN = mySumm3, nsim = 100, verbose = TRUE, .progress = 'txt')
>
> ###########################
> Here is what I get:
> ###########################
> = 1 :List of 3
> $ message : chr "pwrssUpdate did not converge in 30 iterations"
> $ call : NULL
> $ cppstack: NULL
> - attr(*, "class")= chr [1:4] "std::runtime_error" "C++Error" "error" "condition"
> = 2 :List of 3
> $ message : chr "pwrssUpdate did not converge in 30 iterations"
> $ call : NULL
> $ cppstack: NULL
> - attr(*, "class")= chr [1:4] "std::runtime_error" "C++Error" "error" "condition"
> == 3 : Named num [1:2] -2.75 -13.22
> - attr(*, "names")= chr [1:2] "beta.(Intercept)" "beta.aspectRatio.c"
> = 4 :List of 3
> $ message : chr "pwrssUpdate did not converge in 30 iterations"
> $ call : NULL
> $ cppstack: NULL
> - attr(*, "class")= chr [1:4] "std::runtime_error" "C++Error" "error" "condition"
> = 5 : Named num [1:2] -2.98 -14.46
> - attr(*, "names")= chr [1:2] "beta.(Intercept)" "beta.aspectRatio.c"
> = 6 :List of 3
> $ message : chr "pwrssUpdate did not converge in 30 iterations"
> $ call : NULL
> $ cppstack: NULL
> - attr(*, "class")= chr [1:4] "std::runtime_error" "C++Error" "error" "condition"
> == 7 : Named num [1:2] -2.83 -13.75
> - attr(*, "names")= chr [1:2] "beta.(Intercept)" "beta.aspectRatio.c"
> ...
> = 20 :List of 3
> $ message : chr "pwrssUpdate did not converge in 30 iterations"
> $ call : NULL
> $ cppstack: NULL
> - attr(*, "class")= chr [1:4] "std::runtime_error" "C++Error" "error" "condition"
> = 21 : Named num [1:2] -2.87 -13.83
> - attr(*, "names")= chr [1:2] "beta.(Intercept)" "beta.aspectRatio.c"
> = 22 :List of 3
> $ message : chr "pwrssUpdate did not converge in 30 iterations"
> $ call : NULL
> $ cppstack: NULL
> - attr(*, "class")= chr [1:4] "std::runtime_error" "C++Error" "error" "condition"
> == 23 :List of 3
> $ message : chr "pwrssUpdate did not converge in 30 iterations"
> $ call : NULL
> $ cppstack: NULL
> - attr(*, "class")= chr [1:4] "std::runtime_error" "C++Error" "error" "condition"
> = 24 : Named num [1:2] -2.77 -13.69
> - attr(*, "names")= chr [1:2] "beta.(Intercept)" "beta.aspectRatio.c"
> ...
> ###########################
>
> R version 3.0.1 (2013-05-16)
> Platform: x86_64-apple-darwin10.8.0 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] grid splines datasets utils stats graphics grDevices methods base
>
> other attached packages:
> [1] boot_1.3-9 scales_0.2.3 effects_2.2-4 colorspace_1.2-2 MuMIn_1.9.5 lme4_0.99999911-8
> [7] RcppEigen_0.3.1.2.1 Rcpp_0.10.4 Matrix_1.0-12 lattice_0.20-15 sos_1.3-5 brew_1.0-6
> [13] ggplot2_0.9.3.1 car_2.0-18 nnet_7.3-7 MASS_7.3-27
>
> loaded via a namespace (and not attached):
> [1] dichromat_2.0-0 digest_0.6.3 gtable_0.1.2 labeling_0.2 minqa_1.2.1 munsell_0.4.2
> [7] nlme_3.1-110 plyr_1.8 proto_0.3-10 RColorBrewer_1.0-5 reshape2_1.2.2 stringr_0.6.2
> [13] tools_3.0.1
>
>
>
> ______________________________________________
> Professor Michael Kubovy
> University of Virginia
> Department of Psychology
> for mail add: for FedEx or UPS add:
> P.O.Box 400400 Gilmer Hall, Room 102
> Charlottesville, VA 22904-4400 485 McCormick Road
> USA Charlottesville, VA 22903
> room phone
> Office: B011 +1-434-982-4729
> Lab: B019 +1-434-982-4751
> WWW: http://www.people.virginia.edu/~mk9y/
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
> _______________________________________________
> 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