**********
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)
mySumm <- function(.) { s <- sigma(.)
    c(beta =getME(., "beta"), sigma = s, sig01 = unname(s * getME(., "theta"))) }
mySumm2 <- function(.) {
c(beta=fixef(.),sigma=sigma(.),sig01=unlist(VarCorr(.)))
}
e1ba.mer2 <- glmer(response.f ~ aspectRatio.c + (aspectRatio.c | subNum), family = binomial, data = e1ba)
(t00 <- mySumm2(e1ba.mer2))
boo01 <- bootMer(e1ba.mer2, mySumm2, nsim = 1000)
# Error in names(val) <- paste("sim", seq_len(nsim), sep = "_") : 
#  'names' attribute [1000] must be the same length as the vector [1]


> sessionInfo()
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      datasets  utils     stats     graphics  grDevices methods   base     

other attached packages:
 [1] boot_1.3-9          effects_2.2-4       colorspace_1.2-2    gmodels_2.15.4      lme4_0.99999911-8   RcppEigen_0.3.1.2.1
 [7] Rcpp_0.10.4         Matrix_1.0-12       lattice_0.20-15     devtools_1.3        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       evaluate_0.4.4     gdata_2.13.2       gtable_0.1.2       gtools_3.0.0      
 [7] httr_0.2           labeling_0.2       memoise_0.1        minqa_1.2.1        munsell_0.4.2      nlme_3.1-110      
[13] parallel_3.0.1     plyr_1.8           proto_0.3-10       RColorBrewer_1.0-5 RCurl_1.95-4.1     reshape2_1.2.2    
[19] scales_0.2.3       splines_3.0.1      stringr_0.6.2      tools_3.0.1        whisker_0.3-2     



______________________________________________
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]]

