source("Zhang_simfuns.R") library(lme4) glmer_4.L_fun <- function(...) { g0 <- glmer(y~x+(x|id),data=simfun(...),family=binomial) coef(summary(g0)) } glmer_4.GH5_fun <- function(...) { g0 <- glmer(y~x+(x|id),data=simfun(...),family=binomial,nAGQ=5) coef(summary(g0)) } nMCMC <- 500 set.seed(1001) fn <- "Zhang_glmersim.RData" reslist <- list() reslist$res_glmer_4.L <- sfun2(glmer_4.L_fun,nMCMC=nMCMC,savename="glmersim") save("reslist",file=fn) reslist$res_glmer_4.GH5 <- sfun2(glmer_4.GH5_fun,nMCMC=nMCMC,savename="glmersim") save("reslist",file=fn) if (FALSE) { L <- load("current_run.RData") source("Zhang_simfuns.R") library(lme4) ## debug(fun) ans <- try(withCallingHandlers({ww <- 0; fun(n=nvec[j],tau=tauvec[i])}, warning = function(w) { ww <<- match(w$message,cmsg)}),silent=TRUE) fun(n=nvec[i],tau=tauvec[j]) fun(n=nvec[i],tau=tauvec[j]) }